본문 바로가기

코딩

[Python] 백준 #1373. 2진수 8진수

https://www.acmicpc.net/problem/1373

 

1373번: 2진수 8진수

첫째 줄에 2진수가 주어진다. 주어지는 수의 길이는 1,000,000을 넘지 않는다.

www.acmicpc.net

 

# 1373 - Python 3

import sys

input = sys.stdin.readline

print(oct(int(input(), 2))[2:])     # oct 내장함수 이용