print(all([0,15,3]))# all全部都是可迭代的元素时返回TRUE
print(all([1,15,3]))
print(any([1,15,3]))#any任意一个是可迭代的元素时返回TRUE
print(any([]))
print(ascii([1,2,"开挂"])) #转换成ASCII码
a = ascii([1,2,"开挂"])
print(type(a),[a])
print(bin(1))#数字十进制转二进制
print(bin(2))
bin(8)
print(bin(255))
a = bytes("abcde",encoding="utf-8")
print(a)
print(a.capitalize(),a)
print(bool(0))
print(bool(1))
print(bool([1]))
b = bytearray("abcde",encoding="utf-8")
print(b[0])
b[1] = 100
print(b)
print(callable([]))#后面加()都是可调用的(callable判断是否可调用)
chr(87) #参数必须是数字,转换为ASCII码中的字符
ord('a')#ASCII码的位置
#字符创变成执行代码
code ="for i in range(10):print(i)"
c = compile(code,'','exec')
print(c)
exec(code)
dict()#生成一个默认字典
a = ()
print(dir(a)) #有什么方法
eval()
def sayhi(n):
print(n)
for i in range(n):
print(i)
sayhi(3)
#(lambda n:print(n))(5)
calc = lambda n:print(n)
calc(5)
res = filter(lambda n:n>5,range(10))#filter过滤,返回迭代器
for i in res:
print(i)
res = map(lambda n:n*n,range(10))#[i*2 for i in range(10)]
res1 =[lambda i:i*2 for i in range(10)]
for i in res:
print(i)
import functools
res = functools.reduce(lambda x,y:x+y,range(10))#0+1+2+……+9
res1 = functools.reduce(lambda x,y:x*y,range(1,10))
print(res)
print(res1)
a = frozenset([1,2,4,333,4,2,12])#冻结集合,不可修改
print(globals())#获取当前程序中的所有变量
print(hash(12333))#哈希算法
print(hash('alex'))
内置函数说明可参见http://www.cnblogs.com/sesshoumaru/p/6140987.html