while is perfect for input validation:
password = ""
while password != "secret":
password = input("Enter password: ")
print("Access granted")
The loop keeps asking until the user types "secret". Each iteration reads new input and checks it.
You can also count attempts:
attempts = 0
while password != "secret" and attempts < 3:
password = input("Password: ")
attempts += 1
This allows maximum attempts. Multiple conditions combine with and.