CSCA20H3 Lecture Notes - Dic Entertainment, Canada Goose, Standard Streams

87 views11 pages
School
Course
Professor

Document Summary

Def: unordered, mutable collection of key/value pairs: recall that sets are unordered and distinctive terms. The keys form a set, so any particular key can appear at most once in a dictiorory: the keys are immutable, but the values associated with the key doeesn"t have to be immutable. -use the if k in d: print ". Here you need to know the methods for dictionrary, we will represent birds* eagle"+ in a more general form: d[ k"] So del d* k"+ is to remove an entry from a dictionary. First: dic ,similar to sets, which are unordered. Secondly , when looping alist, the values in the list * a","ba","c"+ , which is a", ba", c" , are: loop variable: =index. >>> for (i,v) in enumerate(a): print i,v. Note the different notation you use for dictiornary. But to call the value associated with the key, you need to use [: dictiornary* keyname"+

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

Related Documents

Related Questions