摘要:
>>> l = list('sdf')>>> l['s', 'd', 'f']>>> id(l)4520422000>>> l.reverse()>>> id(l)4520422000>>> l.extend(list('fff'))>>> id(l)4520422000>>> l.sort()>>... 阅读全文
2015年8月10日
摘要:
>>> l = list('sdfsdf')>>> l['s', 'd', 'f', 's', 'd', 'f']>>> t = tuple(l)>>> t('s', 'd', 'f', 's', 'd', 'f')>>> id(l), id(t)(4361251080, 4361140128) .. 阅读全文
摘要:
>>> l = list('sdfsdf')>>> l['s', 'd', 'f', 's', 'd', 'f'] 阅读全文
2015年8月8日
摘要:
如果for循环完整结束,无break打断循环,那么执行else里面的内容,否则不执行。while True: n = raw_input('>') for x in n: if x == 'f': print 'find it.' ... 阅读全文
摘要:
import stringalphas = string.lettersnums = string.digitsmyinput = raw_input('>')for x in myinput: if x in alphas + nums: balabala.....每次循环都会... 阅读全文