Class Notes (837,616)
Canada (510,370)
CSC108H1 (113)
Lecture

october 31 notes

1 Page
79 Views
Unlock Document

Department
Computer Science
Course
CSC108H1
Professor
Michelle Craig
Semester
Fall

Description
 Checks for adjectent duplicates 1. zipcode_list = [1,2,2,5,4,1,2] 2. 3. duplicates = False 4. 5. for k in range(len(zipcode_list)-1): 6. 7. if zipcode_list[k] == zipcode_list[k+1]: 8. duplicates = True 9. 10. # if we get this far and we haven't returned then return False 11. # but this isn't a function so it won't work 12. 13. print duplicates 14. 15. for k in range(1, len(zipcode_list)): #t his also works 16. 17. if zipcode_list[k] == zipcode_list[k-1]: 18. duplicates = True  Invert a dictionary, reverse keys and their associated values
More Less

Related notes for CSC108H1

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