Skip to content

Commit 03bad44

Browse files
committed
Email Validation(using String function)
1 parent 2f0859c commit 03bad44

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

mailstring.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
email = input("Enter Your Email: ")
3+
i=0
4+
j=0
5+
k=0
6+
7+
if len(email) >= 6:
8+
if email[0].isalpha():
9+
if ("@" in email) and (email.count("@") == 1):
10+
if (email[-4] == ".") ^ (email[-3] == "."):
11+
for mail in email:
12+
if mail == mail.isspace():
13+
i = 1
14+
elif mail.isalpha():
15+
if mail == mail.upper():
16+
j = 1
17+
elif mail.isdigit():
18+
continue
19+
elif mail == "_" or mail == "." or mail == "@":
20+
continue
21+
else:
22+
k = 1
23+
if i == 1 or j == 1 or k == 1:
24+
print(
25+
"Wrong Email: You might have spaces or other condition not correct")
26+
else:
27+
print("Email Validated!")
28+
else:
29+
print("Wrong Email: Check email and type again")
30+
else:
31+
print("Wrong Email: Check email and type again")
32+
else:
33+
print("Wrong Email: Check email and type again")
34+
else:
35+
print("Wrong Email: Check email and type again")

0 commit comments

Comments
 (0)