Python for Beginners: The Ultimate Guide to Python Programming; Learn Python FAST! (Python for Beginners, Python Programming, Python Language, Python Book 1) by Joshua Welsh

Python for Beginners: The Ultimate Guide to Python Programming; Learn Python FAST! (Python for Beginners, Python Programming, Python Language, Python Book 1) by Joshua Welsh

Author:Joshua Welsh
Language: eng
Format: azw3, epub
Published: 2016-12-11T08:00:00+00:00


if userIn in assignment1Grades: # the beauty of technology!

print assignment1Grades[userIn]

else:

print “That’s not a valid name.”

Notice how we fetched the value mapped to the key represented by the userIn value. Save this and test it by entering student names and then things that aren’t there at all. It should print out the grades mapped to the names if you enter a proper name or tell you the name is invalid otherwise.

A lot of places uses a keymap system very similar to this. Think of grocery stores, where every item has a SKU number or a UPC code that is linked to it. You can actually reverse search an item by SKU to find the exact model. It’s super impressive, and a real-world application of this technology so you don’t find yourself thinking “when will I ever use this?”



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.