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
This is another option, faster than len(set(x))==1 for long lists (uses short circuit)
len(set(x))==1
def constantList(x): return x and [x[0]]*len(x) == x