CS 1301 Lecture 9: Day 9 Notes (13 June)
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. ")