Pythondex

Exercise

Dictionaries Exercise

In this exercise, you'll practice creating and manipulating a dictionary. You’ll store information about a person and print details.

Task

Write a Python program that:

  • Creates a dictionary with keys: name, age, and city
  • Adds a new key email with any value
  • Updates the age key with a new number
  • Prints all keys and values
  • Hints: use dict[key] = value to add or update, print(dict) to display

Example Output

Solve