目录
常用内置函数
abs/round/sum
eval/exec
enumerate
max/min
sorted
zip
map
filter
补充:reduce
lambda
初识递归
再谈递归
递归函数与二分查找算法
回到顶部
常用内置函数
Built-in Functions
abs()
dict()
help()
min()
setattr()
all()
dir()
hex()
next()
slice()
any()
divmod()
id()
object()
sorted()
ascii()
enumerate()
input()
oct()
staticmethod()
bin()
eval()
int()
open()
str()
bool()
exec()
isinstance()
ord()
sum()
bytearray()
filter()
issubclass()
pow()
super()
bytes()
float()
iter()
print()
tuple()
callable()
format()
len()
property()
type()
chr()
frozenset()
list()
range()
vars()
classmethod()
getattr()
locals()
repr()
zip()
compile()
globals()
map()
reversed()
__import__()
complex()
hasattr()
max()
round()
delattr()
hash()
memoryview()
set()
回到顶部
abs/round/sum
>>> abs(1)>>> abs(-1) #求绝对值
>>> round(1.234,2)1.23
>>> round(1.269,2) #四舍五入
1.27
>>> sum([1,2,3,4])>>> sum((1,3,5,7)) #接收数字组成的元组/列表