2 python: Unicode 和list 列表

1 unicode

2 list 列表及其内置函数等

3 不一样的for语句

Python 的 for 语句依据任意序列(链表或字符串)中的子项,按它们在序列中的顺序来进行迭代

>>> # Measure some strings:
... a = ['cat', 'window', 'defenestrate']
>>> for x in a:
...     print x, len(x)
...
cat 3
window 6
defenestrate 12

 4 函数定义 关键字def 函数名(函数参数1,函数参数2,...)

posted on 2017-09-14 22:43  马勇123  阅读(190)  评论(0编辑  收藏  举报

导航