-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday28.py
More file actions
37 lines (29 loc) · 801 Bytes
/
day28.py
File metadata and controls
37 lines (29 loc) · 801 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
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Consider a database table, Emails, which has the attributes First Name
and Email ID. Given N rows of data simulating the Emails table,
print an alphabetically-ordered list of people whose email address ends in @gmail.com.
"""
#!/bin/python3
import math
import os
import random
import re
import sys
def check_gmail(email):
is_gmail = re.findall(r'\w+@gmail.\w+',email)
if(is_gmail):
return True
else:
return False
if __name__ == '__main__':
N = int(input())
list = []
for N_itr in range(N):
firstNameEmailID = input().split()
firstName = firstNameEmailID[0]
emailID = firstNameEmailID[1]
if check_gmail(emailID):
list.append(firstName)
list.sort()
for i in list:
print(i)