forked from qiwsir/StarterLearningPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq38.py
More file actions
24 lines (21 loc) · 587 Bytes
/
q38.py
File metadata and controls
24 lines (21 loc) · 587 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
# coding=utf-8
import re
def validate_email(email):
if len(email) > 4:
if re.match("^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,6}$", email) != None:
return True
else:
return False
if __name__ == "__main__":
while True:
e = input("Input your email('q'-exit):")
if e == "q":
print("Bye!")
break
else:
r = validate_email(e)
if r:
print("The email is right.")
else:
print("sorry, the email is not right.")