Ad

Returns True if atleast 2 booleans are True

Code
Diff
  • def solution(param: list) -> bool:
        """Returns True if atleast 2 out of 3 booleans are True."""
        return sum([1 for a in param if str(a) == 'True' and type(a) == bool]) >= 2
    • def solution(param: list) -> bool:
    • """Returns True if atleast 2 out of 3 booleans are True."""
    • return sum(p is True for p in param) > 1
    • return sum([1 for a in param if str(a) == 'True' and type(a) == bool]) >= 2