1.abs(x)绝对值 #coding=utf-8 a = 1 b = -2 print(abs(a)) print(abs(b)) 2.all(iterable)可迭代对象里面所有内容为真返回真,空列表返回真 #非0就是真 l = [1, 2, 3, 4, 5, 6, -1, -2, 'a'] print(all(l))#True l = [1, 2, 3, 4, 5, 6, 0, -2, 'a'] print(all(l))#False l = [] print(all(l))#True 3