Introduction
Dictionaries help you store and find data quickly by using keys instead of just numbers. They make it easy to organize information like a real-life address book.
Jump into concepts and practice - no test required
my_dict = {
'key1': 'value1',
'key2': 'value2'
}phone_book = {'Alice': '123-456', 'Bob': '987-654'}settings = {'volume': 10, 'brightness': 70}empty_dict = {}contacts = {
'John': '555-1234',
'Jane': '555-5678',
'Doe': '555-0000'
}
print("John's number is", contacts['John'])
# Add a new contact
contacts['Alice'] = '555-9999'
print("Alice's number is", contacts['Alice'])my_dict = {'name': 'Alice', 'age': 25}phone_book = {'Alice': '1234', 'Bob': '5678'}
print(phone_book['Bob'])contacts = {'John': '1111'}
contacts.add('Mary', '2222')students = [('Anna', 85), ('Ben', 90), ('Anna', 95)]