Flow controls: Loops · 22 / 26 Exercise Medium

Access control

Objective

Write a Python program that requests the user's username and password.

It should repeat until the login is user and the password is password or up to a maximum of 3 attempts.

If the username and password are correct, display Login successful; otherwise, display Login error.

Input
admin
admin
admin
admin
user
password
Output
Login error
Login error
Login successful

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise