answer = ''
d = {} #dictionary with enter data
count = 0
while(True):
if (count == 0):
d["first_name"] = input("What is your first name?: ")
elif (count == 1):
d["last_name"] = input("What is your last name?: ")
d["Student_id"] = input("Student id: ")
else:
answer = input("Enter the next class, STOP to end: ")
if answer == "STOP":
break
d[answer] = int(input("Enter the room number: "))
count += 1
Comments
Leave a comment