0
Q:

how to true elements in an array python

# Python3 program to count True booleans in a list 
  
def count(lst): 
  
    return sum(bool(x) for x in lst) 
      
# Driver code 
lst = [True, False, True, True, False] 
print(count(lst)) 
0

New to Communities?

Join the community