Generation

generate functionThu, 23 Mar 2023

crea un inicio de sesión con un máximo de 3 intentos y si se falla que se cierre

def login(user, password): while(True): i = 0 while(i<3): if(user == 'a' and password == 'b'): print('Welcome') return True else: print('Wrong username or password') i = i + 1 user = input('User: ') password = input('Password: ') print('You have exceeded the maximum number of attempts') return False login('a', 'b')

Questions about programming?Chat with your personal AI assistant