def should_compress(filename):
 for extension in EXCLUDE_TYPES:
  if filename.endswith(extension):
   return False
 return True

def should_compress ( filename ) : for extension in EXCLUDE_TYPES : if filename . endswith ( extension ) : return False return True
check if the filename is a type of file that should be compressed .