feat(r-1.4_scratch.py): assigned sum of squares to a var and added input prompt
This commit is contained in:
@@ -16,9 +16,8 @@ def squares_sum(n):
|
||||
list.append(n)
|
||||
if n == 1:
|
||||
square_list = [m*m for m in list]
|
||||
print(square_list)
|
||||
squares = sum(square_list)
|
||||
print(squares)
|
||||
|
||||
|
||||
|
||||
|
||||
squares_sum(5)
|
||||
squares_sum(int(input("Enter a positive integer: ")))
|
||||
Reference in New Issue
Block a user