Advertisement
compiler13

Email Validation

Aug 26th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import re
  2.  
  3. n = int(input())
  4.  
  5. rs = "circlefintech.com"
  6. s1 = {}
  7. s2 = {}
  8. li = []
  9.  
  10. for i in range(n):
  11.     s = input()
  12.     a = s.index("@")
  13.     s1 = s[:a + 1]
  14.     s2 = s[a + 1:]
  15.  
  16.     if (re.search('^[a-z]+@', s1)) or (re.search('^[a-z]+_+@', s1)) or (re.search('^[a-z]+_+[0-9]+@', s1)):
  17.  
  18.         li.append(1)
  19.      
  20.  
  21.     else:
  22.         li.append(0)
  23.      
  24.  
  25. for i in range(len(li)):
  26.  
  27.     if (li[i] == 1) and (s2 == rs):
  28.         print(True)
  29.  
  30.     else:
  31.         print(False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement