feat(r-1.4_scratch.py): isolated list of squares of positive integers smaller than n
This commit is contained in:
@@ -15,10 +15,9 @@ def squares_sum(n):
|
||||
n = n - 1
|
||||
list.append(n)
|
||||
if n == 1:
|
||||
square_list = []
|
||||
for val in list:
|
||||
square_list.append(val*val)
|
||||
print(square_list)
|
||||
square_list = [m*m for m in list]
|
||||
print(square_list)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user