Check if email is valid with Python
Level: Beginner
Your task for today is to create a command-line email validator that checks if email addresses follow the correct format, helping you learn pattern matching and string validation.
Project Task
Create an email validator that:
Takes email addresses as input from the user
Uses the re (regular expressions) library to validate email format
Checks for proper email structure (username@domain.extension)
Displays whether each email is valid or invalid
Allows users to validate multiple emails in one session
Provides clear feedback on validation results
Uses a simple regex pattern to match valid email formats
This project gives you hands-on practice with regular expressions, string validation, and input handling — essential skills for data validation and form processing.
Expected Output
Email Validator
===============
Enter an email address (or ‘quit’ to exit): john.doe@example.com
✓ Valid email: john.doe@example.com
Enter an email address (or ‘quit’ to exit): invalid-email@
✗ Invalid email: invalid-email@
Enter an email address (or ‘quit’ to exit): user@domain.co.uk
✓ Valid email: user@domain.co.uk
Enter an email address (or ‘quit’ to exit): @nodomain.com
✗ Invalid email: @nodomain.com
Enter an email address (or ‘quit’ to exit): test.user@company.org
✓ Valid email: test.user@company.org
Enter an email address (or ‘quit’ to exit): quit
Thank you for using Email Validator!
Join the Python & AI Builders Skool Community
Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:
https://skool.com/automateit
Skeleton and Solution
Below you will find both a downloadable skeleton.py file to help you code the project with comment guides and the downloadable solution.py file containing the correct solution.
Get the code skeleton here:
Keep reading with a 7-day free trial
Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.


