运行结果如下:
while 1 :
temp=input("请输入一个整数(输入Q结束程序):")
if temp =="Q":
break
else:
num = int(temp)
Bin = bin(num)
print("十->十六:"+"%d->%#X"%(num,num))
print("十->八:"+"%d->%#o"%(num,num))
print("十->二:"+"%d->"%(num)+Bin)