3 ms·
Of course, this will run through the whole list, no matter what... def is_constant(l): return reduce(lambda x, y: x and (y == l[0]), l, True)
by balding_n_tired 17y ago
Of course, this will run through the whole list, no matter what...
def is_constant(l):
return reduce(lambda x, y: x and (y == l[0]), l, True)