##################################################整理###########################################PS : 如下必掌握 # 1 数字# int(..) # 2 字符串# replace /find /join /strip /startwith /split /upper /lower /format # 格式化方法一:template = "i am {name},age : {age}"v = template.format(name = "ZZX",age = "19")print(v) #格式化方法二:template = "i am {name},age : {age}"v = template.format(**{"name":"ZZX","age":"19"})print(v) #三,列表# append,extend,insert#索引,切片,循环 #四,元组#忽略#索引,切片,循环, 一级元素不可被修改 #五,字典#ger/update/keys/values/items#索引 dic = { "k1":"v1"} v1 = "k1" in dic.keys()print(v1) v1 = "v1" in dic.values()print(v1) #六 布尔值# bool(..)# None "" () [] {} 0 ==> False# bool([]) bool(()) bool("")... ==>False
原文地址:https://www.cnblogs.com/159357zzx/p/11588428.html
时间: 2024-12-09 20:51:05