Python Dictionaries and List Comprehensions
Posted on Jun 9th, 2021
Today’s topics
- Dictionaries
- Tuples
- Lists and list comprehensions
🐍 Code Break
🎯 Project
Continue yesterday’s project, Word Frequency. A dictionary will help you solve the problem of counting words.
At minimum you should be able to count words and print that count, even if the formatting of your output is not 100% on point.
Working groups for tonight
Don’t struggle through code by yourself! Work together with these folks so you can get to the finish line with Word Frequency.
groups = [
['Sara', 'Dee', 'Roan'],
['Greg', 'Brian', 'Emily'],
['Shaune', 'Wendy', 'Robert'],
['Logan', 'Quinten', 'Ellie'],
]
🔖 Resources
- RealPython: Python lists and tuples
- Python Docs: List comprehensions
- Python list comprehensions explained visually
- RealPython: Sorting in Python
- Python Docs: Dictionaries
🦉 Code & Notes
- Notes
- Intro to Python notebooks (Notebooks 8-11)
- Example from class: dictionaries