Warm-Up: Jupyter Notebooks and Python Dictionaries

Warm-Up: Jupyter Notebooks and Python Dictionaries#

In this section we use a Jupyter Notebook to briefly review and practice with dictionaries, a fundamental Python data type that is extremely useful, but you probably don’t remember from prior courses.

The code on this page can be used interactively: click –> Live Code in the top right corner, then wait until the message Python interaction ready! appears.

When this page is activated a special version of Python will be loaded into your web browser that enables you to interact with this page as if it were a Jupyter Notebook. Note that package import does not work the same as it would on a “normal” computer, so the necessary imports have already been prepared for you.

The download button provides a *.ipynb file which you can run on your computer to make sure you have Python and Jupyter installed correctly in your IDE.

Warning

The contents of this page will be updated by the Wednesday, September 4 In-Class Session to include a few brief tips for using Jupyter Notebooks and Python dictionaries.

For now, enjoy the interactive Python page! You can also test your Python session using the download page button (as described above), but note that this file will also be updated when the page is.

engineers = {
    'Nikola Tesla': 1856,
    'Thomas Edison': 1847,
    'Albert Einstein': 1879,
    'Isaac Newton': 1643,
    'Leonardo da Vinci': 1452,
}

for engineer, birth_year in engineers.items():
    print(f'{engineer} was born in {birth_year}.')