-
Notifications
You must be signed in to change notification settings - Fork 3
/
PROJECT3.py
36 lines (32 loc) · 886 Bytes
/
PROJECT3.py
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
def mail(n):
for i in range(n):
email = input("Enter your Email: ").strip()
if '@' and '.com' not in email:
print("Enter valid Mail ID")
if n == 1:
mail(n)
else:
mail(n - (n - 1))
else:
l.append(email)
n -= 1
def checking():
x = input("How many mails would you like to Slice:")
if x.isnumeric():
n = int(x)
if n <= 0:
print("Enter a positive number")
checking()
else:
mail(n)
else:
print("Enter an Integer")
checking()
l = []
checking()
if l != []:
for i in l:
username = i[:i.index('@')]
domain = i[i.index('@') + 1:]
domain = domain.upper()
print(f"your username is {username} & domain is {domain}")