def file_doesnt_endwith(test, endings):
 if (not isfile(test)):
  return False
 for e in endings:
  if test.endswith(e):
   return False
 return True

def file_doesnt_endwith ( test , endings ) : if ( not isfile ( test ) ) : return False for e in endings : if test . endswith ( e ) : return False return True
return true if test is a file and its name does not end with any of the strings listed in endings .