-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
  • 2,221
  • 6
  • 30
  • 56

1 Answers1

1

you can use filter for these sorts of things:

list(filter(lambda x: email.endswith(x),trusted))
joppich
  • 681
  • 9
  • 20