Class Notes (835,727)
Canada (509,353)
CSCA20H3 (25)
Lecture

Dictionary.docx

11 Pages
192 Views
Unlock Document

Department
Computer Science
Course
CSCA20H3
Professor
Benj Hellie
Semester
Winter

Description
Dictionary 4112012 55000 PM DictionaryDef unordered mutable collection of keyvalue pairso 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 o The keys are immutable o But the values associated with the key doeesnt have to be immutableHow to test if a key is in a dictioryuse the if k in d print Here you need to know the methods for dictionrary we will represent birdseaglein a more general form dk So del dk is to remove an entry from a dictionary For loops how they differ in dic and listsFirst dic similar to sets which are unorderedo Secondlywhen looping alist the values in the list abac which is a ba careo Loop variable index Recall the enumeratea1 2 3 4 5 for iv in enumerateaprint iv 0 11 22 33 4
More Less

Related notes for CSCA20H3

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit