📜  Python int 到二进制字符串 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:27.537000             🧑  作者: Mango

代码示例4
number = 5
print('The binary equivalent of 5 is:', bin(number))

# output - The binary equivalent of 5 is: 0b101
# "0b" indicates that this is a binary number
# 101 is the number (2**2 * 1) + (2**1 * 0) + (2**0 * 1) = 5