12345
Back to Lesson

Dictionary Building via Zip

Instantiate dicts combining external label and data sequences.

Instructions

  • Given
    headers = ["ID", "Name", "Role"]
    and
    row = [101, "Alice", "Admin"]
    .
  • Construct a dictionary mapping each header key to its respective row value.
  • You can use the
    dict()
    keyword paired exclusively with
    zip(...)
    to achieve this dynamically and effortlessly! Print the resulting map.
main.py
main.py