Exercise 1: Introduction to Dictionaries
Welcome to Python 2, Lesson 2! Today, we'll learn about dictionaries, a powerful and flexible data structure in Python.
What is a Dictionary?
A dictionary is an unordered collection of key-value pairs. It's also known as an associative array, hash table, or hash map in other programming languages.
Here's how to create a simple dictionary:
Now it's your turn! Create a dictionary called student_scores with the following information:
- Alice: 85
- Bob: 92
- Charlie: 78
After creating the dictionary, print it to see the result.
# Create the student_scores dictionary here
# Print the dictionary