Day 28: RegEx, Patterns, and Intro to Databases

  • + 8 comments

    You could get even more Pythonic (also conforming to PEP 8)

    import re
    
    lst=[]
    for a0 in range(int(input())):
        firstName, emailID = [str(s) for s in input().split()]
        if re.search('@gmail\.com$', emailID):
       	    lst.append(firstName)
    print(*sorted(lst), sep='\n')