Check if list contains only item x

A=[w,y,x,z]
all(p == x for p in A)

Leave a Comment