This code is fully functional without the use of error handling. Is there a more efficient way to write this? I'd love to learn from all of you.
from getpass import getpass
username = input("Username: ")
grant_access = False
while not grant_access:
password = getpass("Password: ")
if password == 'pass123':
grant_access = True
elif password != 'pass123':
while not grant_access:
password = getpass("Re-enter Password: ")
if password == 'pass123':
grant_access = True
elif password != 'pass123':
continue
print("Logging in...")