Chap1
1.comment
文档字符串的注释,模块,类,函数
def foo():
''This is a doc string''
return true
2.列表和元组
list可以更改,元组不行,但都可以进行切片运算
>>> alist = [1,2,3,4]
>>> alist[:3]
[1,2,3]
>>>alist[2:]
[3,4]
>>>aTuple = ('robots',77,93,'try)
>>>aTuple[:3]
('robots',77,93)
3.print 后加一个逗号可以不必换行
4.格式化输出
print ‘We are the %s who say %s' % ( who,((what+' ') *4))