Discuss / Python / 感觉自己写的好麻烦...

感觉自己写的好麻烦...

Topic source

wwyforN

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

def f(x): return str(hex(x)) n1=255 n2=1000 print(f(n1)) print(f(n2))

其实可以直接使用hex()的,毕竟这是python自带的函数


  • 1

Reply