python必会内置函数


# print(bool('s'))#把一个对象转换成布尔类型
# int()#整形
# float()#小数
# str()#zifuc
# dict()#字典
# list()#列表
# set()#集合
# tuple()#元组
# print(round(11.1198,2))#取几位小数,会四舍五入
#print(sorted([2,31,34,6,1,23,4],reverse=False))#排序
## print(max(111,12,13,14,16,19))#取最大值
# print(list(filter(func,[0,1,2,3,4])))#在python3里面这么用是没问题
#print(filter(func,[0,1,2,3,4]))#在python2里面这么用是没问题
# filter(func,[1,2,3,4])
#根据前面的函数处理逻辑,依次处理后面可迭代对象里面的每个元素,返回true保存
# print(list(map(func, [0,1, 2, 3, 4])))
#根据前面的函数处理逻辑,依次处理后面可迭代对象里面的每个元素,保存前面函数返回的所有结果 </span>
posted @ 2017-06-15 17:39  喵咪的博客  阅读(208)  评论(0编辑  收藏  举报