"""Consider an array/list of sheep where some sheep may be missing from their place.
We need a function that counts the number of sheep present in the array (true means present).

For example,

[True,  True,  True,  False,
  True,  True,  True,  True ,
  True,  False, True,  False,
  True,  False, False, True ,
  True,  True,  True,  True ,
  False, False, True,  True]
The correct answer would be 17.

Hint: Don't forget to check for bad values like null/undefined"""

array1 = [True,  True,  True,  False,
          True,  True,  True,  True ,
          True,  False, True,  False,
          True,  False, False, True ,
          True,  True,  True,  True ,
          False, False, True,  True ];


def count_sheeps(sheep):
  return print("There are {} sheeps in total, not {}".format(sheep.count(True),len(sheep)))

count_sheeps(array1)

# 01/06/2021 RW
"""Consider an array/list of sheep where some sheep may be missing from their place.
We need a function that counts the number of sheep present in the array (true means present).

For example,

[True,  True,  True,  False,
  True,  True,  True,  True ,
  True,  False, True,  False,
  True,  False, False, True ,
  True,  True,  True,  True ,
  False, False, True,  True]
The correct answer would be 17.

Hint: Don't forget to check for bad values like null/undefined"""

array1 = [True,  True,  True,  False,
          True,  True,  True,  True ,
          True,  False, True,  False,
          True,  False, False, True ,
          True,  True,  True,  True ,
          False, False, True,  True ];


def count_sheeps(sheep):
  return print("There are {} sheeps in total, not {}".format(sheep.count(True),len(sheep)))

count_sheeps(array1)

# 01/06/2021 RW
Consider an array/list of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).  For example,  [True,  True,  True,  False,   True,  True,  True,  True ,   True,  False, True,  False,   True,  False, False, True ,   True,  True,  True,  True ,   False, False, True,  True] The correct answer would be 17.  Hint: Don't forget to check for bad values like null/undefined # 01/06/2021 RW