{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "dictionary_warmup.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "Jj1t_tPN2oXt" }, "source": [ "# Warm Up\n", "\n", "1. Use a dictionary to store information about a (real or made up) person you know. Store their first name, last name, age and the city in which they live. You should have keys such as `first_name`, `last_name`, and `city`. Add more if you have time. Print each piece of information stored in the dictionary.\n", "\n", "2. A Python dictionary can be used to model an actual dictionary. Let's call it a glossary to avoid confusion. \n", " - Think of 5 programming words you've learned about in the previous lessons. Use these words as the keys in your glossary, and store their meanings as values. i.e concatenation, data types, list, array\n", " - Print each word and its meaning as neatly formatted output. You might print the word followed by a colon and then its meaning, or print the word on one line and then print its meaning indented on a second line. Use the newline character `\\n` to insert a blank line between each word-meaning pair in your output.\n", "- you can use a f-string `f\"{code} string here\"`\n", "- `concatenation: your definition`\n", "\n", "3. Pick a favorite topic. Could be numbers, colors, food, ect. Poll at least 5 people in your breakout room and create a dictionary with each person's name as the key and their favorite thing as the value.\n", " - Does anyone have the same favorite? How would you figure this out without seeing the dictionary? i.e if you could only loop through the dictionary" ] }, { "cell_type": "code", "metadata": { "id": "o6HgrNUg318L" }, "source": [ "" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "sz9rs7am2nxq" }, "source": [ "" ], "execution_count": null, "outputs": [] } ] }