Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
layer_count = int(input("n: "))
total = 0
for layer in range(1, layer_count + 1):
total += layer * layer
print("Sum of squares:", total)