Is there a way to set a 30 second timer to verify a username for a program before it returns back to the start line, and requests for the user to input the name again? This is what I have so far:
print("")
verifyp1loop = True
while verifyp1loop==True:
verifyp1 = input("Please input Player 1's username. ")
verifyp1confirm = input("Are you sure you want this to be your username? y/n ")
if verifyp1confirm == "y":
print("Username confirmed.")
verifyp1loop=False
else:
print("Username denied.")
verifyp2loop = True
while verifyp2loop==True:
verifyp2=input("Please input Player 2's username. ")
verifyp2confirm=input("Are you sure you want this to be your username? y/n ")
if verifyp2confirm == "y":
print("Username confirmed.")
verifyp2loop=False
else:
print("Username denied.")
I'm very new to this and any help would be appreciated :)