Apr-29-2022, 08:34 PM
(Apr-29-2022, 06:51 PM)deanhystad Wrote: You should not use recursion for this. Instead of having validate call login if validation fails, login should call validation in a loop until the validation is successful.
def validate(user, password): if StandardUsers().get(user) == password: MainMenu()#go to mainMenu return True return False def login(): while True: user = input("Enter your name: ") password = input("Enter your password: ") if validate(user, password): break else: print('You are not registered to use this program')
Thanks for the advice.