摘要: python的删除dela=[1,2,3,4,5,6]del a[0]a>>> [2,3,4,5,6]del a[2:4]a>>> [2,3,6]del a[:]a>>> []del aa#抛出异常,>>>NameError:name 'a' is not definedwhile /passwhile True:pass #什么也不做is用来比较两个变量是否是指向同一内存地址(也就是两个变量是否等价)==是用来比较两个变量是否逻辑相等a=[1,2]b=[1,2]>>> a is bFal 阅读全文
posted @ 2012-10-17 14:28 sgsheg 阅读(263) 评论(0) 推荐(0) 编辑