How could I add something (probably a loop), to this code to make it so that if the wrong thing is entered it makes the user start again?
Usernames = ['Bob', 'Dave']
Passwords = ['Password1']
UsernameCheck = str(input("Player 1 - Enter your username: "))
UsernameCheck2 = str(input("Player 2 - Enter your username: "))
PasswordCheck = str(input("Player 1 - Enter your password: "))
PasswordCheck2 = str(input("Player 2 - Enter your password: "))
if UsernameCheck and UsernameCheck2 in Usernames and PasswordCheck and PasswordCheck2 in Passwords:
print("Your credentials are valid")
else:
print("Your credentials are invalid, try again")