Assign Person to Occupation

Published by comecheckoutmycode in

You have two lists. One shows the names of the people names, while the other shows their occupation jobs. Your task is to create a dictionary displaying each person to their respective occupation.

PersonJob
AnnieTeacher
StevenEngineer
LisaDoctor
OsmanCashier

Example

names = ["Dennis", "Vera", "Mabel", "Annette", "Sussan"]
jobs = ["Butcher", "Programmer", "Doctor", "Teacher", "Lecturer"]

assign_person_to_job(names, jobs) ➞ {
  "Dennis": "Butcher",
  "Vera": "Programmer",
  "Mabel": "Doctor",
  "Annette": "Teacher",
  "Sussan": "Lecturer"
}

Notes

  • The two lists have the same length.
  • The index of a name in the names list is the same as the index of the person's job in the jobs list, as shown in the table above.
  • Check Resources for some useful information that can help with this challenge.
Watch a quick demo on how Edabit works.