CSC108H1 Lecture Notes - Html Element

20 views2 pages
11 Jan 2013
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

Suppose we want a list of adjectives describing someone. >>> adjectives_1 = [ disagreeable , smart , funny , distracted , pretty ] >>> adjectives_2 = [ helpful , tall , funny , smart , polite ] >>> description_3 = [ dan , adjectives_3] #first time is a string, second item a list. [ diane , [ disagreeable , smart , funny , distracted , pretty ]], [ my_ta , [ helpful , Tall , funny , smart , polite ]], [ dan , [ musical , funny , frustrating , smart ]] >>> for i in [0,1,2,3,4]: #print list of adjectives diane. Print description[0][1][index] cooperative smart funny distracted pretty. >>> for item in descriptions[0][1]: #also print list of adjectives associated with diane. Print item cooperative smart funny distracted pretty. >>> for item in descriptions[0][1]: #suppress separate line. Print item, cooperative smart funny distracted pretty. >>> for item in description[2][1]: #only for access list, not change item.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers