Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
set() solution in Clear category for All the Same by EdinsonUwU
from typing import List, Any
def all_the_same(elements: List[Any]) -> bool:
if elements == []:
return True;
a = set(elements)
return len(a) == 1
if __name__ == '__main__':
print("Example:")
print(all_the_same([1, 1, 1]))
Dec. 15, 2020