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,...)

原文地址:https://www.cnblogs.com/fyp7077/p/7523661.html