Skip to content

Commit 6f12ed9

Browse files
author
alisharify
committed
Add Response
1 parent ab32dde commit 6f12ed9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

week-7/response/response.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from validator_collection import email
2+
from validator_collection.errors import InvalidEmailError
3+
4+
5+
6+
def main():
7+
x = (IS_VALID_EMAIL(input("What's your email address? ")))
8+
if x:
9+
print("Valid")
10+
else:
11+
print("Invalid")
12+
13+
14+
def IS_VALID_EMAIL(s):
15+
"""This Function Validation s is valid email or not"""
16+
try:
17+
email(s)
18+
except InvalidEmailError:
19+
return False
20+
21+
return True
22+
23+
24+
25+
26+
if __name__ == "__main__":
27+
main()

0 commit comments

Comments
 (0)