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
Or use diff method of numpy:
import numpy as np def allthesame(l): return np.unique(l).shape[0]<=1
And to call:
print(allthesame([1,1,1]))
Output: