Codio
Project
File
Edit
Find
View
Tools
Education
Help
Configure.
Project Index (static)
Configure..
squared.py
6. 3. Squared
X
WNH
# Get N from the command line
import sys
Collapse
Challenges
N = int(sys. argv[1])
# Your code goes here
number = N
6. 3. Squared
for number in range (0, N, +1) :
number = number * number
print (number)
10
total = str (number)
We will provide you with a value N. You
should calculate the sum of each value of
N squared from 0 up to and including N.
In mathematical notation, this is written as
So if we passed in 3, you would output
02 + 12 + 22 + 32 = 14
Check It!
X
LAST RUN on 9/23/2019.
12:10:37 PM
Program Output
Program Failed for Input:
2
Expected Output: 5
Your Program Output: 0
1
Your output was
incorrect. Try again.