#Takes user's email and stores it in a variable
userEmail = input("Please enter email: ").lower()
while '@' not in userEmail or '.com\' not in userEmail or userEmail == '': #Checks if email has a valid format
if (userEmail == ''):
userEmail = input("Field is empty. Please enter an email address: ").lower().strip()
else:
userEmail = input("\nIncorrect format. Please re-enter email address: ").lower().strip()
So the code above is supposed to get an email address from a user and it error checks for if the user put in a .com
and @
when inputting.
However, when I run the code; if the user puts is name@**@**gmail.com
or name@gmail.com**m**
it takes it as the right format.
What is a way to limit the number of characters a user can input on after a certain character within a string?