79587917

Date: 2025-04-23 05:56:33
Score: 1
Natty:
Report link

python Dictionary doctors_location contains key-value pairs that represent the room number of each doctor. Dictionary patient_directory contains key-value pairs that represent the patient in each room. String doctor_name is read from input. Complete the following tasks:

Assign room_num with the value associated with key doctor_name in doctors_location. Any string that is not a key in doctors_location has default value -999.

Use pop() to remove room_num from patient_directory and assign patient_name with the value returned. Any number that is not a key in patient_directory has default value 'no patient'.

Click here for examples If the input is Ford, then the output is:

Ford (room 212) is seeing Pat.

Remaining patients:

{155: 'Del', 235: 'Kai', 449: 'Kim'}

If the input is Sims, then the output is:

Sims (room -999) is seeing no patient.

Remaining patients:

{155: 'Del', 212: 'Pat', 235: 'Kai', 449: 'Kim'}

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Nicky Amey