YouTube Excerpt: Learn how to use dictionaries in Python — the fast, flexible data structure that powers everything from simple apps to large systems. Dictionaries ("dicts") are, without question, the most important data structure in Python, because they're both fast and flexible. In this lesson, I cover dictionaries — what they are, how they work, and how to use them effectively, both by themselves and with other data structures. To download the Jupyter notebook I created when teaching this lesson, sign up (for free) at https://PythonForNonProgrammers.com . ----- Homework exercises for this lesson: 1. Create a dictionary named menu, in which the keys are dishes at a restaurant and the values are prices. Ask the user what they want to order, repeatedly, until they give an empty string. If their order is on the menu, then print the price and the total so far. (I know, waiters never do this!) If their order is not on the menu, tell them that it’s not available. When the loop exits (i.e., the order is done), give them the final total. 2. Ask the user to enter one word at a time. When the user enters an empty string (i.e., nothing), stop asking. Use a dict to count how many times each character (letter, number, space, symbol) appears across all of the user’s inputs.
Learn how to use dictionaries in Python — the fast, flexible data structure that powers everything from simple apps to large systems. Dictionaries...
Curious about Python For Non-programmers, Lesson 9: Dictionaries's Color? Explore detailed estimates, salary breakdowns, and financial insights that reveal the full picture of their profile.
color style guide
Source ID: yD8DdeuqPFU
Category: color style guide
View Color Profile 🔓
Disclaimer: %niche_term% estimates are based on publicly available data, media reports, and financial analysis. Actual numbers may vary.
Sponsored
Sponsored
Sponsored