feat(r-1.4_scratch.py): created while loop reducing value of n to 0

This commit is contained in:
baphim
2026-09-04 22:06:39 -04:00
parent cfc2a3d500
commit ad608ade66
+12
View File
@@ -4,5 +4,17 @@
Created on Fri Sep 4 21:18:16 2026
@author: joseph
Write a short Python function that takes a positive integer n and returns the
sum of the squares of all the positive integers smaller than n.
"""
def squares_sum(n):
list = []
while n >= 1:
n = n - 1
print(n)
squares_sum(12)