def arrive(name, roster): roster[name] = True def check(name, roster): return name in roster classdict = {} ans = input("a to arrive, c to check, q to quit") while ans != "q": if ans == "a": student = input("give a student's name") arrive(student, classdict) elif ans == "c": student= input("who do you want to check?") if check(student,classdict): print(student,"is here") else: print(student,"is not here") ans = input("a to arrive, c to check, q to quit") print(classdict)