value = 30
b = bin(value)
o = oct(value)
x = hex(value)
print(b)
print(o)
print(x)
# 0b11110
# 0o36
# 0x1e
value = 30
b = format(value, '#b')
o = format(value, '#o')
x = format(value, '#x')
print(b)
print(o)
print(x)
# 0b11110
# 0o36
# 0x1e
value = 30
b = format(value, 'b')
o = format(value, 'o')
x = format(value, 'x')
print(b)
print(o)
print(x)
# 11110
# 36
# 1e
b = int('0b111100', 2)
o = int('0o74', 8)
h = int('0x3c', 16)
print(b)
print(o)
print(h)
# 60
# 60
# 60
int(string, base)
print(int('101',2))
print(int('202',3))
print(int('303',4))
print(int('404',5))
print(int('505',6))
print(int('ACF',16))
# 5
# 20
# 51
# 104
# 185
# 2767
a = divmod(10, 3)
print(a)
# (3, 1)
⚠ 당연히, 두번째 인자에 0을 집어 넣으면 에러 발생
(ZeroDivisionError: integer division or modulo by zero)