HomePython Page 5 - Python Conditionals, Lists, Dictionaries, and Operators
Dictionaries - Python
In our last article we learned how to get input from the user, store data in a variable, and work with some basic operators to manipulate that data. In this article we will learn to use Conditional Statements and possibly create functions. So wipe that mustard off your chin, clean the dishes, and let's get to work.
Another way to store multiple values is with a dictionary. The difference between a List and a dictionary is that dictionaries are unordered and do not use indexes. The best way to understand them is to see them at work:
This is because the value to the left of the colon (:) acts as the index, while the value to the right of the colon acts as the value being referenced.