fork download
  1. def count_sheep(sheep):
  2. count=0
  3. for n in sheep:
  4. if n:
  5. count+=1
  6. return count
  7.  
  8. sheep =[ True, True, True, False,
  9. True, True, True, True,
  10. True, False, True, False,
  11. True, False, False, True,
  12. True, True, True, True,
  13. False, False, True, True ]
  14.  
  15. print(count_sheep(sheep))
  16.  
  17.  
Success #stdin #stdout 0.02s 7228KB
stdin
Standard input is empty
stdout
17