1.bool,all,any
(1)当内容为空时
>>> a=[] >>> bool(a) False >>> all(a) True >>> any(a) False
(2)当有内容时
>>> a = [1,2] >>> all(a) True >>> a = [1,""] >>> all(a) False >>> any(a) True
2.dir()
>>> a = 1 >>> b = 2 >>> c =3 >>> dir() ['__builtins__', 'a', 'b', 'c', 'sys'] #打印当前程序所有的变量
3.hex()
>>> a = 1 >>> hex(a) '0x1' #转成16进制
4.diamond()
>>> divmod(10,3) (3, 1) #取余