day 12 内容整理
####################### 整理 ################# # 一、数字 # int(..)
二、字符串
# replace/find/join/strip/startswith/split/upper/lower/format
# tempalte = "i am {name}, age : {age}" # # v = tempalte.format(name='alex',age=19) # v = tempalte.format(**{"name": 'alex','age': 19}) # print(v)
# 三、列表 # append、extend、insert # 索引、切片、循环
# 四、元组 # 方法忽略 # 索引、切片、循环 一级元素不能被修改
# 五、字典 # get/update/keys/values/items # for,索引,不能切片,
# dic = { # "k1": 'v1' # } # v = "k1" in dic k1是不是在k中 # print(v) # v = "v1" in dic.values() 判断是不是在valuse中 # print(v)
六、布尔值
0 1
bool(...)
None "" () [] {} 0 ==> 空字典,空列表,空元组 这些都是False