立即學習:https://edu.csdn.net/course/play/26755/340112?utm_source=blogtoedu
進制轉換
n1 = 1234
print(n1)
n2 = 0B11101
print(n2)
n8 = 0O127
print(n8)
n16 = 0XF15
print(n16)
# 進制轉換
# 2 -> 10
print(int("10110", 2))
# 8 -> 10
print(int("10110", 8))
# 16 -> 10
print(int("10110", 16))
# 10 -> 2
print(bin(120))
# 10 -> 8
print(oct(54321))
# 10 -> 16
print(hex(54321))