CSC108H1 Lecture : october 03 notes
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
Every value in python has a truth associated with it. 54 [100] creates a new int value, doesn"t change the original int x = x * 2. # does not return; the new int. value associated with x not called upon. # x does double because local memory deletes after function completes. >>> name = raw_input( please enter our name ) >>> ou in colour true #gives a boolean result. >>> # loop over characters in a string: loops. >>> for sample in snd: # for in : #make variable same refer to the first item, then execute body of loop. #make variable sample refer to the second item, the execute body of loop . Print char m y s t r i n g. >>> for ch in s: #ch can be any character. Print ch*5, mmmm yyyyy sssss ttttt rrrrr iiiii nnnnn ggggg.