From b8ab9f2822c9e1b637393b32db1f1b3a66eb5f98 Mon Sep 17 00:00:00 2001
From: Absinthe <bradley_small@hotmail.com>
Date: Thu, 19 Sep 2019 09:39:37 -0400
Subject: [PATCH] cleaning up and commenting

---
 coco.py | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/coco.py b/coco.py
index 52f8389..9073476 100755
--- a/coco.py
+++ b/coco.py
@@ -1,4 +1,10 @@
 def splitthem(quant):
+    """
+    take a quantity and return False if it is not one more than 
+    equally divisible by 5
+
+    Otherwise, subtract 1 and subtract 1/5 of the remaining
+    """
     if quant[0] % 5 != 1:
         return False
     else:
@@ -7,22 +13,42 @@ def splitthem(quant):
 
 
 def testnum(num):
+    """
+    for a given number test to see if it will succeed using the 
+    logic for split defined in splitthem 5 times.
+
+    Then test to see that it is equally divisible by 5
+
+
+    """
     for pers in range(5):
-        if (False == splitthem(num)):
+        if not splitthem(num):
             return False
+
     if num[0] % 5 == 0:
         return True
+    else:
+        return False
 
 
 def main():
+    """
+    Main driver for the brute force solver
+
+    choose a number and see if the result can be found and return 
+    or print an error
+
+    """
+    TESTQUANTITY = 1000000
+
     num = [0]
-    for n in range(1, 10000):
+    for n in range(1, TESTQUANTITY):
         num[0] = n
         if testnum(num):
-            print "The Number Was %d" % (n)
+            print ("The Number Was %d" % n)
             return
 
-    print "Not found in 10000 tries"
+    print ("Not found in %d tries." % TESTQUANTITY)
 
 
 if __name__=="__main__":
-- 
GitLab