Day 28: RegEx, Patterns, and Intro to Databases

  • + 0 comments

    My solution in Python

    import math import os import random import re import sys

    if name == 'main':

    new_list = []
    N = int(input().strip())
    
    for N_itr in range(N):
        first_multiple_input = input().rstrip().split()
    
        firstName = first_multiple_input[0]
    
        emailID = first_multiple_input[1]
    
        if '@gmail' in emailID:
          new_list.append([firstName, emailID])
    
    [print(L[0]) for L in sorted(new_list, key=lambda x: x[0])]