用户:千手修罗SUMMIT查看:1 回复:1 评论:1 创建时间:2019-08-17T14:48:02
【作品展示】

【作品介绍】
Python
【作品源代码】
def math2(a):
q = []
result = ''
while a:
b = (a % 2)
a = a//2
q.append(b)
q.reverse()
for each in q:
w = str(each)
result = (result + w)
return result
print('千手修罗SUMMIT制作')
print('使用说明:')
print('可将输入的十进制整数转化为二进制数值')
while True:
e = input('请输入十进制整数:')
while (not e.isdigit()):
e = input('ERROR,您的输入有误,请输入一个整数:')
e = int(e)
print(math2(e))
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn