姓名:刘浩然。 2020年大目标Python

day12 Python数字,字符串,列表,元祖,字典总结

一、数字

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})
#在列表中传字典加**,看到**联想可能有字典

三、列表

append、extend、insert
索引、切片、循环

四、元祖

忽略
索引、切片、循环         以及元素不能被修改

五、字典

get/update/keys/values/items
for,索引

dic = {
    "k1": 'v1'
}

v = "k1" in dic
print(v)

v = "v1" in dic.values()

六、布尔值

0 1
bool(...)
None ""  () []  {} 0 ==> False
posted @ 2019-01-31 16:58  pluto2charon  阅读(149)  评论(0编辑  收藏  举报