I want to write a function:
def CheckBoolean(lst):
if the list only contains True or False, it will return True, otherwise it will return False
You can use Python built-in function all for this.
result = all(isinstance(item, bool) for item in last)
allreturnTrueif all elements of the iterable are true (or if the iterable is empty).