I need a function which takes in a list and outputs True if all elements in the input list evaluate as equal to each other using the standard equal
list
True
Regarding using reduce() with lambda. Here is a working code that I personally think is way nicer than some of the other answers.
reduce()
lambda
reduce(lambda x, y: (x[1]==y, y), [2, 2, 2], (True, 2))
Returns a tuple where the first value is the boolean if all items are same or not.