Commits

Domantas Jackūnas committed 360eb34 Draft

completed #28 task

  • Participants
  • Parent commits bfe3a6d

Comments (0)

Files changed (1)

File completed/28.py

+total_range = 1001 * 1001
+total_sum = 1
+counter = 1
+space = 2
+loop = 0
+
+while not counter >= total_range:
+    loop += 1
+    counter += space
+    total_sum += counter
+
+    # reset
+    if loop == 4:
+        space += 2
+        loop = 0
+
+print 'Total sum %s' % total_sum