python里面有哪些自带函数?

如题所述

python系统提供了下面常用的函数:
1. 数学库模块(math)提供了很多数学运算函数;
2.复数模块(cmath)提供了用于复数运算的函数;
3.随机数模块(random)提供了用来生成随机数的函数;
4.时间(time)和日历(calendar)模块提供了能处理日期和时间的函数。
注意:在调用系统函数之前,先要使用import 语句导入 相应的模块
该语句将模块中定义的函数代码复制到自己的程 序中,然后就可以访问模块中的任何函数,其方 法是在函数名前面加上“模块名.”。
希望能帮到你。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2022-05-15
python3内置函数:
abs()
all()
any()
ascii()
bin()
bool()
bytearray()
bytes()
callable()
chr()
classmethod()
compile()
complex()
delattr()
dict()
dir()
divmod()
enumerate()
eval()
exec()
filter()
float()
format()
frozenset()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int()
isinstance()
issubclass()
iter()
len()
list()
locals()
map()
max()
memoryview()
min()
next()
oct()
open()
ord()
pow()
print()
property()
range()
repr()
reversed()
round()
set()
setattr()
slice()
sorted()
staticmethod()
str()
sum()
super()
tuple()
type()
vars()
zip()
不过我个人觉得int(),float()和str()之类的不算函数,因为它们是内置的类,在进行像a = int('1')这样的操作时,不是用了int函数,而是把int类实例化了。 (*^▽^*)
相似回答