当前位置:首页 / 文章测试 / Python所学函数及方法

Python所学函数及方法

开始打字练习

常用函数:

input()

print()

range()

open()

close()

ord()

chr()

eval()

pow()

divmod()

dir()

hex()

oct()

bin()

max()

min()

sum()

len()

type()

abs()

round()

id()

int()

float()

complex()

迭代器生成器:

iter()

next()

yield()

tuple()

bool()

字符串常用函数:

str()

center()

format()

count()

index()

find()

split()

strip()

lstrip()

rstrip()

replace()

join()

upper()

lower()

is函数:

isalnum()

isupper()

islower()

isalpha()

isdigit()

isdecimal()

isspace()

endswith()

startswith()

swapcase()

列表相关放法:

list()

append()

extend()

insert()

clear()

del

pop()

remove()

reverse()

sort()

tuple()

集合的常用方法:

set()

add()

remove()

discard()

clear()

字典的常用方法:

zip()

dict()

get()

keys()

values()

items()

fromkeys()

copy()

deepcopy()

update()

popitem()

pop()

sorted函数

其他模块:

math.pi

math.sqrt()

math.log()

random.random()

random.randint()

random.choice()

random.uniform()

random.shuffle()

random.sample()

random.randrange()

string 模块:

string.ascii_letters

string.ascii_uppercase

string.ascii_lowercase

string.digits

声明:以上文章均为用户自行发布,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。