print(f
'{ hex(15) = }')
print(f
'{ hex(-15) = }')
print(f
'{ hex(0) = }')
print(f
'{ hex(0b11111111) = }')
print(f
'{ hex(0o20) = }')
print(f
'{ hex(0x7f) = }')
class C:
def __index__(self
):
return 65535
print(f
'{ hex(C()) = }')
代码来自周华健的网课 - 《轻松学习Python 69个内置函数》 https://edu.csdn.net/course/play/31010/459524?spm=1002.2001.3001.4143
转载请注明原文地址: https://lol.8miu.com/read-28593.html