美文网首页
python笔记

python笔记

作者: whve | 来源:发表于2018-11-20 16:03 被阅读0次

不可变类型:
1.字符串str
'python'
2.元组tuple
tup=1,2,3

可变类型:
1.列表list
['p','y']
2.字典dict
{'a':'somevalue'}
3.集合
4.推导式

控制流
if
elif
……
else

for循环
for value in collection:
#对value做一些处理

三元表达式
value = true-expr if condition else false-expr
等价于
if:
value = true-expr
else:
value = false-expr

函数

相关文章

网友评论

      本文标题:python笔记

      本文链接:https://www.haomeiwen.com/subject/sqjxqqtx.html