Question: Report Structure: explain the results. students = { } def add _ student ( ) : for i in range ( 1 , 6 )
Report Structure:
explain the results.
students
def addstudent:
for i in range:
printfEnter information for student i:
studentid strinputID:
gpa floatinputGPA:
name inputName:
age intinputAge:
student ID: studentid "GPA": gpa, "Name": name, "Age": age
studentsstudentid student
def searchstudentstudentid:
student students.getstudentid
if student:
return student
else:
return None
def showstudents:
if students:
for studentid student in students.items:
printStudent Information:"
printfID: studentID
printfGPA: studentGPA
printfName: studentName
printfAge: studentAge
print
else:
printNo students to display."
while True:
printMenu:
print Add student"
print Search student"
print Show all students"
print Exit"
choice intinputChoose :
if choice :
addstudent
elif choice :
studentid strinputEnter ID of student to search for:
result searchstudentstudentid
if result:
printStudent found!"
printresult
else:
printStudent not found."
elif choice :
showstudents
elif choice :
printExiting program"
break
else:
printInvalid choice. Please choose
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
