num을 “0b” 가 앞에 붙은 이진 문자열로 변환하고 반환합니다.
num이 정수가 아닌 경우 __index_() 메서드를 구현하여 정수를 반환해야 합니다.
number = 5 print('The binary equivalent of 5 is:', bin(number))
결과
13 python에서 에러가 생겨도 계속 실행하는 방법
11 Python에서 exception이 생긴 라인 숫자값을 어떻게 구할 수 있나요?
11 python에서 에러가 발생한 후에도 코드 실행을 계속할 수 있는 방법
11 파이썬에서 string, datetime으로 정렬하기
14 에러가 있는데 Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'
© 2022 pinfo. All rights reserved.