python
woquNOKIA
这个作者很懒,什么都没留下…
展开
-
python 字符串
>>>"Let's go!""Let's go!">>>'Let's go!'SyntaxError:: Invalid syntax>>>'Let\'s go!'"Let's go!">>>'"hello word!" she said'原创 2018-08-01 11:43:32 · 260 阅读 · 0 评论 -
python 序列-列表
分片>>> numbers = [1,2,3,4,5,6,7,8,9,10]>>> numbers[3:6]#开始包含结尾不包含([))[4, 5, 6]>>> numbers[0:1][1]>>> numbers[7:10][8, 9, 10]>>> numbers[-3:-1]原创 2018-08-02 10:54:01 · 399 阅读 · 0 评论 -
python 序列-元组
>>> 1,2#元组(大部分)使用圆括号(1, 2)>>> ()#空元组()>>> 4242>>> 43,#一个值的元组(43,)>>> 3*(40+2,)#3个值一样的元组(42, 42, 42)tuple函数将一个序列转换为元组>>&原创 2018-08-02 11:24:23 · 254 阅读 · 0 评论 -
python del/exec/eval
>>> x =1>>> del x>>> xTraceback (most recent call last): File "<pyshell#55>", line 1, in <module> xNameError: name 'x' is not defined>&am原创 2018-08-07 13:50:44 · 201 阅读 · 0 评论