Question
Create a program studentDatabase(numStudents) that allows user to specify the number of students with numStudents to input ID numbers and names and stores the information
Create a program studentDatabase(numStudents) that allows user to specify the number of students with numStudents to input ID numbers and names and stores the information using the dictionary data structure. Then, it allows the user to look up a student by their ID number. The program should gracefully exit when the user enters a blank.
Sample Output:
>>> studentDatabase(3)
>>> Enter id of a new student: 1000
>>> Enter name of the new student: John Garcia
>>> Enter id of a new student: 2000
>>> Enter name of the new student: Lily Lane
>>> Enter id of a new student: 3000
>>> Enter name of the new student: Maria Lee
>>> Enter id to look up: 1000
John Garcia
>>> Enter id to look up: 2000
Lily Lane
>>> Enter id to look up:
Have a good day!
>>> |
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