정수를 나타내는 데 필요한 "바이트 수"
C:\Users\jek>python
Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> 123
123
>>> type(123)
<class 'int'>
>>> 123.bit_length()
File "<stdin>", line 1
123.bit_length()
^
SyntaxError: invalid syntax
>>>
>>> a = 123
>>> type(a)
<class 'int'>
>>> a.bit_length()
7
>>>
>>>
C:\Users\jek>python
Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> int('123')
123
>>> int('123',10)
123
>>> int('123',2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 2: '123'
>>>
>>> int('123', 8)
83
int('십진수 문자열', 변환하고자 하는 진법)
선택가능한 진법은 2부터 36사이!
int('123', 8)은 십진수 문자열 '123'을 8진수로 변환시키는 명령