List indices start at 0, and lists can be sliced, concatenated:,,a = ['spam',
List indices start at 0, and lists can be sliced, concatenated:,,a = ['spam',
a = ['spam', 'eggs', 100, 1234]print a[0]print a[3]print a[-2]print a[1:-1]print a[:2] + ['bacon', 2*2]print 3*a[:3] + ['Boo!']
- If statement: a dictionary-based 'switch'
- Iterating Over Lines with readlines,iteratingreadlines
- if Statements: if, elif and else,statementselif,x = in
- Loop through a list: for in,loopthrough,a = ['cat',
- Generate binary message catalog from textual translation
- Change dictionary entry,dictionaryentry,d2 = {'spam'
热门文章:
相关内容
- If statement: a dictionary-based 'switch',,choice =
- Iterating Over Lines with readlines,iteratingreadlines,f = open('fi
- if Statements: if, elif and else,statementselif,x = int(raw_
- Loop through a list: for in,loopthrough,a = ['cat',
- Generate binary message catalog from textual translation description,
- Change dictionary entry,dictionaryentry,d2 = {'spam'
- Concantenate a string by '\',concantenatestring,bar
- Write Unicode strings directly to flout,stringsflout,import codec
- Button font: underline italic,underlineitalic,from Tkinter
- Tuple is not changable,tuplechangable,T = (1, 2, 3
评论关闭