Python 常用语法速查表
数据类型
int/float/str/bool/list/tuple/dict/set/None字符串
s.upper()/lower()/strip()/split()/join()/replace()/find()/startswith()/format()/f"{x}"列表
lst.append(x)/extend(lst)/insert(i,x)/remove(x)/pop(i)/sort()/sorted()/len()/in字典
d.get(key,default)/d.keys()/d.values()/d.items()/d.update()/del d[key]循环
for item in iterable:/for i in range(n):/while cond:/[x for x in lst if cond]函数
def fn(a,b=0,*args,**kwargs):/lambda x: x*2文件
with open(f) as f: f.read()/f.readlines()