abs
取绝对值
all
print(all([1,-3,3]))#有不为0的就是真
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 True 3 4 Process finished with exit code 0
any
print(any([1,-3,0])) #有一个为真就为真
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 True 3 4 Process finished with exit code 0
ASCII
print(ascii([1,-3,‘大大勾拳‘])) #把内存的数据对象变成一个可打印的字符串
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 [1, -3, ‘\u5927\u5927\u52fe\u62f3‘] 3 4 Process finished with exit code 0
bin
print(bin(255)) #把数字从十进制转二进制
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 0b11111111 3 4 Process finished with exit code 0
bool
print(bool([]))#判断真假,有数据就是真,没有数据就是假
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 False 3 4 Process finished with exit code 0
bytearry
b=bytearray(‘abcde‘,encoding=‘utf-8‘)#字节数组 可修改的二进制 print(b[1]) b[1]=50 #把二进制变成数组的格式,并且可以进行修改 print(b)
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 98 3 bytearray(b‘a2cde‘) 4 5 Process finished with exit code 0
callable
def as1():pass print(callable([])) #判断是否可以被调用
1 C:\Users\Administrator\PycharmProjects\untitled3\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/2018-2-27/测试.py 2 False 3 4 Process finished with exit code 0