-4

What would be the quickest way to make sure the following is trusted:

email = "foobar@gmail.com"

trusted = [".co.uk", ".com", ".net", ".edu", ".ac.uk"]
GCien
  • 1,991
  • 6
  • 27
  • 55

1 Answers1

1

you can use filter for these sorts of things:

list(filter(lambda x: email.endswith(x),trusted))
joppich
  • 671
  • 9
  • 18