Use the Pythonic way to check for entries in a list