I would like to validate the data that the user has entered in my program (an email address). If the user enters an '@' symbol, the program should accept it. If it does not, the program should loop and ask for the email again. So far I have attempted to do this, but the program loops for every character that has been entered:
emailright = True
while emailright == True:
email = input("Please enter your email address")
character = ("@")
for character in email:
if character == '@':
print("Your email address had been registered")
emailright = True
else:
print("invalid email address, please re-enter")
emailright = False
The while loop and everything inside it has also been indented. Thank you!