-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmail_Validation.py
More file actions
42 lines (36 loc) · 1.18 KB
/
Email_Validation.py
File metadata and controls
42 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
email = input("Enter your email address: ")
p = 0 # p is for valid email
c = 0 # c is for invalid email
if " " not in email:
if (email.count("@") == 1) and (email.count(".") == 1):
if len(email) > 8 :
if email[0].isalpha():
user,comp,domain = email[:email.index("@")], email[email.index("@")+1:email.index(".")], email[email.index(".")+1:]
if len(domain)>1 and len (domain)<4:
if domain.islower():
p = p+1
else:
c = c+1
if comp.isalpha():
p = p+1
else:
c = c+1
for ch in user:
if ch.isalnum() or ch == "_":
p = p+1
else:
c = c+1
else:
c = c+1
else:
c = c+1
else:
c = c+1
else:
c = c+1
else:
c = c+1
if c != 0 :
print("Invalid Email")
elif c==0 or p!=0:
print("Valid Email")