A helpdesk tech's "who is this person" quick-reference script. Ten labs, nothing but Modules 2-3 — lists, dicts, indexing, safe access. No loops yet, so every lookup here is direct.
Create employee = {"name": "Diego Alvarez", "department": "IT", "email": "dalvarez@example.com"}. Print one formatted line: "NAME -- DEPARTMENT (EMAIL)".
Diego Alvarez -- IT (dalvarez@example.com)Create a list of 3 employee dicts (name + department each) for Diego Alvarez (IT), Priya Nair (Security), and Owen Clarke (Sales). Access the first one by [0] and print "NAME -- DEPARTMENT".
Diego Alvarez -- ITCreate departments = ["IT", "Security", "Sales"]. Print whether "Security" is in the list, then whether "Marketing" is — two lines, using in.
True then FalseCreate employee = {"name": "Priya Nair", "department": "Security"} — no phone field. Print employee.get("phone", "No phone on file").
No phone on fileCreate employee = {"name": "Owen Clarke", "department": "IT"}. Print employee["department"]. Then reassign employee["department"] = "Security" (a department transfer) and print it again.
IT then SecurityCreate employee = {"name": "Diego Alvarez", "manager": {"name": "Lin Park", "email": "lpark@example.com"}}. Print just the manager's name — employee["manager"]["name"].
Lin ParkCreate a list of 3 employee dicts, each with a nested "manager" dict (name + email). Print the THIRD employee's manager's email in one chained expression: employees[2]["manager"]["email"].
lpark@example.com (or whatever email you gave that manager)Create employee = {"name": "Priya Nair", "temp_password": "Xy9!work2"} (issued at account creation). Print the dict. Then .pop("temp_password") it (simulating first login) and print the dict again.
{'name': 'Priya Nair', 'temp_password': 'Xy9!work2'} then {'name': 'Priya Nair'}Create base_info = {"name": "Owen Clarke", "department": "Sales"} and contact_info = {"email": "oclarke@example.com", "phone": "555-0134"} — two separate systems' data on the same person. Merge them with {**base_info, **contact_info} and print the result.
{'name': 'Owen Clarke', 'department': 'Sales', 'email': 'oclarke@example.com', 'phone': '555-0134'}Build a small directory: a list of 5 employee dicts, where some have a "manager" key and some have a "phone" key, and most don't have either. Pick one specific employee by index. Print a 4-line "Employee Lookup Result" card: name, department, phone (guarded with .get(), default "Not on file"), and manager name (guarded, default "No manager on file") — reusing every mechanic from Labs 1-9.
Employee Lookup Result: Owen ClarkeDepartment: SalesPhone: 555-0134Manager: No manager on file
Open problems/tier02_employee_lookup.py and do all 10 problems locally. Run python check.py in problems/ to grade everything.