Question
Objective Take user inputs and add them to the nested dictionary data structure. Action The insert function should take patient's first name, last name, the
Objective
Take user inputs and add them to the nested dictionary data structure.
Action
The insert function should take patient's first name, last name, the birth month when the vaccine was administered. The birth month should be an integer. (Use loop when possible). Check the sample sheet
Patient name: John Smith | ||||
Patient record number: R001 | ||||
Vaccine | months | |||
HepB | 0 | 1 | 6 | |
RV | 2 | 4 | 6 | |
DTaP | 2 | 4 | 6 | 15 |
Hib | 2 | 4 | 6 | 12 |
PCV13 | 2 | 4 | 6 | 12 |
IPV | 2 | 4 | 6 | |
IIV4 | Annual | |||
MMR | 12 | |||
VAR | 12 | |||
HepA | 12 | |||
Patient name: Olivia James | ||||
Patient record number: R002 | ||||
Vaccine | months | |||
HepB | 0 | 1 | 6 | |
RV | 2 | 4 | 7 | |
DTaP | 2 | 5 | 7 | 12 |
Hib | 2 | 4 | 6 | 12 |
PCV13 | 2 | 5 | 7 | 12 |
IPV | 2 | 5 | 8 | |
IIV4 | Annual | |||
MMR | 12 | |||
VAR | 12 | |||
HepA | 12 |
Use nested dictionary. Use patient variable to store the dictionary. Each entry in the dictionary should have a "record number" which serve as a key. Research how nested dictionary is defined. Each record number represents single patient and has nested key:value.
Verify that the patient dictionary has all data.
Call the insert function again and add one record. The new record should be appended and not overwritten existing records. Verify that the patient dictionary has all data.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started