Day 28: RegEx, Patterns, and Intro to Databases

  • + 0 comments
    if __name__ == '__main__':
        N = int(input().strip())
        gmail = []
        
        for N_itr in range(N):
            first_multiple_input = input().rstrip().split()
    
            firstName = first_multiple_input[0]
            emailID = first_multiple_input[1]
    
            domain = emailID.split("@")[1]
            
            if domain == "gmail.com":
                gmail.append(firstName)
            
        gmail.sort()
            
        for fn in gmail:
            print(fn)