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