Best way to do this is to use Python sets.You need to define all_same
like this:
def all_same(items):
return len(set(items)) < 2
Test:
>>> def all_same(items):
... return len(set(items)) < 2
...
>>>
>>> property_list = ["one", "one", "one"]
>>> all_same(property_list)
True
>>> property_list = ["one", "one", "two"]
>>> all_same(property_list)
False
>>> property_list = []
>>> all_same(property_list)
True