Ad
Code
Diff
  • solution = lambda x: sum(b for b in x if isinstance(b, bool)) >= 2
    • eval(compile((_:=__import__("ast")).fix_missing_locations(_.Module(body=[_.FunctionDef(name='solution', args=_.arguments(posonlyargs=[], args=[_.arg(arg='l')], kwonlyargs=[], kw_defaults=[], defaults=[]), body=[_.Assign(targets=[_.Name(id='bools', ctx=_.Store())], value=_.ListComp(elt=_.Constant(value=True), generators=[_.comprehension(target=_.Name(id='b', ctx=_.Store()), iter=_.Name(id='l', ctx=_.Load()), ifs=[_.BoolOp(op=_.And(), values=[_.Call(func=_.Name(id='isinstance', ctx=_.Load()), args=[_.Name(id='b', ctx=_.Load()), _.Name(id='bool', ctx=_.Load())], keywords=[]), _.Compare(left=_.Name(id='b', ctx=_.Load()), ops=[_.Eq()], comparators=[_.Constant(value=True)])])], is_async=0)])), _.Return(value=_.Compare(left=_.Call(func=_.Attribute(value=_.Name(id='bools', ctx=_.Load()), attr='__len__', ctx=_.Load()), args=[], keywords=[]), ops=[_.GtE()], comparators=[_.Constant(value=2)]))], decorator_list=[])], type_ignores=[])), "", "exec"))
    • solution = lambda x: sum(b for b in x if isinstance(b, bool)) >= 2