CS 1301 Lecture 9: Day 9 Notes (13 June)

35 views6 pages

Document Summary

###mytup [0] ="b" ##invalid because tuples are immutable. ####tuples are like lists but are immutable like strings. ##a dictionary is a set of keys and values (unordered) ##keys must be unique and immutable types (cannout use list) ####to add to dictionary, aimply create a new key value: value pair. ####to change a value for a particular key, simply create a new key: value pair. ######you cannot find a key for a particular caue using dictionary lookup. ####print(mydict[7]) #can"t go backwards from value to key. ## if mydict[item] > maxsofar and not item in " ,;:": #### create a list of all the letters in the sentence that occur more than once. ##write a function that adds a product to a dictionary or increases the. ## products[prodnum] += count #increase the number of this product. ## print("you do not have enough of this product to sell. ") ## print("sorry, we do not sell that item here. ")

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