def ext_on_list(name, lst):
 for ext in lst:
  if (name.rfind(ext) >= 0):
   return True
 return False

def ext_on_list ( name , lst ) : for ext in lst : if ( name . rfind ( ext ) >= 0 ) : return True return False
return true if name contains any extension in lst .