List offset: start at zero, negative and slicing,negativeslicing,L = ['spam',
List offset: start at zero, negative and slicing,negativeslicing,L = ['spam',
L = ['spam', 'Spam', 'SPAM!']print L[2] # offsets start at zeroprint L[-2] # negative: count from the rightprint L[1:] # slicing fetches sections
- List: Length, Minimum, and Maximum,minimummaximum,numb
- A function definition,functiondefinition,def square(x
- Dictionary: clear method removes all items from the dict
- Dictionary Keys Are Case-Sensitive,keyscase-sensitive,
- Mouse events on a frame: Mouse clicked, position,event
- Read a file line by line,fileline,file = open(
热门文章:
相关内容
- List: Length, Minimum, and Maximum,minimummaximum,numbers = [1
- A function definition,functiondefinition,def square(x
- Dictionary: clear method removes all items from the dictionary,remo
- Dictionary Keys Are Case-Sensitive,keyscase-sensitive,d = {} d['ke
- Mouse events on a frame: Mouse clicked, position,eventsclicked,from
- Read a file line by line,fileline,file = open(
- Built-in function len(): get the length of a list,built-inlen,a = [
- Different way to output string: print and sys.stdout.write,,X = 99p
- Print module infomation,moduleinfomation,//File: modu
- split and join,splitjoin,s = 'this
评论关闭