Back to Lesson

Data Inversion

Construct a dictionary comprehension substituting standard iterations.

Instructions

  • Given
    user_map = {"Alice": 1, "Bob": 2, "Carol": 3}
    .
  • Use a dictionary comprehension to flip the roles — making the dictionary ID standard:
    user_map = {1: "Alice"...}
    .
  • Print the inverted object structure.
main.py
main.py