我想把输入的数字改成二进制码
number = int(input("input num : "))
for num in number:
print(bin(num).split("b")[1])
然而,我得到了
1 number = int(input("input num : "))
2
----> 3 for num in number:
4 num2 = bin(num).split("b")[1]
`TypeError:'int' object is not iterable`
谁能帮我找出哪里错了吗?你知道吗
提前多谢
您可以循环使用字符串的字符,而不是数字的数字。你知道吗
相关问题 更多 >
编程相关推荐