`endswith` can take a tuple, no need for the loop