News

To retrieve a value from a dictionary, you use Python’s indexing syntax: example_values["integer"] # yields 32 # Get the year Blade Runner was released blade_runner_year = movie_years ...
The traditional ways to do this in Python aren’t elegant. One is to write an if/elif/else chain of expressions. The other is to store values to match as keys in a dictionary, then use the values ...