• It Runs ok but it doesn't 'Check'

 

from typing import List, Any

def allthesame(elements: List[Any]) -> bool:

if len(elements) == elements.count(elements[0]) or len(elements) < 1: 
    return True
else:

return False

Example: True

===

IndexError: list index out of range, allthesame, 7 Fail: allthesame([])

.