Loading...
Loading...
Loading...
A sign-up form runs a quick email check. An email is valid when it has no spaces, exactly one @, at least one character before the @, and a domain (the part after @) that contains a dot which is neither the first nor the last character of the domain.
Read one line and print Valid or Invalid.
Valid or Invalid.Example 1
Input
neha@example.com
Output
Valid
Example 2
Input
neha@example
Output
Invalid
The domain has no dot.
Try the problem first. Open one hint at a time.
Test the cheap rules first: spaces and the number of @ signs. Only then split on @.
After the split, the first part is the local name and the second is the domain. Test the domain with in, startswith and endswith.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor