Discuss / Python / This is my work

This is my work

Topic source
#!/usr/bin/env python3
# -*- codint:uft-8 -*-
n1=255
n2=1000
print(hex(n1),hex(n2))
#下面的自由扩展,但是,我TM卡住了!!求解
#自助查询整数的十六进制码
n1=input("请输入你要得到十六进制码的整数:")
#思路就是这样了。但是运行不了啊。~555
print(hex(%s),%n1)

Wuops

#2 Created at ... [Delete] [Delete and Lock User]
# -*- coding: utf-8 -*-
n1=int(input("请输入你要得到十六进制码的整数:"))
print("%s"%(hex(n1)))

lsl787878

#3 Created at ... [Delete] [Delete and Lock User]

input是str的。 所以需要转换成int格式的。


  • 1

Reply