In python, I have a list that should have one and only one truthy value (that is, bool(value) is True). Is there a clever way to check for this
It depends if you are just looking for the value True or are also looking for other values that would evaluate to True logically (like 11 or "hello"). If the former:
def only1(l):
return l.count(True) == 1
If the latter:
def only1(l):
return sum(bool(e) for e in l) == 1
since this would do both the counting and the conversion in a single iteration without having to build a new list.