fork(3) download
  1. import re
  2.  
  3. wzor = r"([A-Za-z0-9\._]{1,20})@([A-Za-z0-9\._]{1,20})\.([A-Za-z]{2,3})"
  4. kropki = r"(\.){2}|(\.@)|(@\.y)"
  5. for _ in range(int(input())):
  6. email = input()
  7. match = re.match(wzor,email)
  8. if not match:
  9. print ("Nie")
  10. elif re.search(kropki,email):
  11. print("Nie")
  12. elif len(match.group())==len(email):
  13. print("Tak")
  14. else:
  15. print("Nie")
Success #stdin #stdout 0.01s 28384KB
stdin
5
mat h@edu.pl
algorytm@edu.pl
algoliga@algoliga.edu.pl
1234@123.PL
1234@123..pl
stdout
Nie
Tak
Tak
Tak
Nie