Back to Practice
#0094
Basic Email Validator
EasyPython15 min10 XP
Problem
Return True when text contains exactly one @, has non-empty local and domain parts, and the domain contains a dot that is not first or last.
Why This Matters
Validation problems train careful condition ordering and realistic edge-case thinking.
Function Signature
def is_basic_email(text):
Examples
Example 1
Input"asha@example.com"
OutputTrue
There is one @, both parts exist, and the domain has a middle dot.
Constraints
- Return the exact structure requested.
- Handle the edge cases mentioned in the prompt.
- Prefer clear logic over clever one-liners.
CodePython
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
Input"asha@example.com"
ExpectedTrue
There is one @, both parts exist, and the domain has a middle dot.
Hidden Test Categories
empty local partdot at end of domainmultiple @ symbols