Browse Source

Create Counting sheep.py

PythonCoder8 3 years ago
parent
commit
3274736c97
1 changed files with 7 additions and 0 deletions
  1. 7 0
      8 kyu/Counting sheep.../Counting sheep.py

+ 7 - 0
8 kyu/Counting sheep.../Counting sheep.py

@@ -0,0 +1,7 @@
+def count_sheeps(sheep):
+    sheepCount, presentSheepCount = 0, 0
+    for i in sheep:
+        sheepCount += 1
+        if i == True:
+            presentSheepCount += 1
+    return presentSheepCount