logo CodeStepByStep logo

squares

Language/Type: Python for
Author: Allison Obourn (on 2017/01/18)

Write for loops to produce the first 5 numbers squared. Your code should produce:

1 4 9 16 25

Note that 1 * 1 = 1, 2 * 2 = 4, 3 * 3 = 9, etc.

Bare code: Write a fragment of Python code as described, without any class or function/method heading around your code.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.