Square numbers
Created on May 22, 2021 by Julien Palard
Print the 10 first square number, one per line.
Start at 0, so the first square number is 02, followed by 12, 22, and so on up to 92.
As a reminder, the power operator in Python is written **
, so:
1 2 |
|
Advices
You'll need a for statement to iterate over the range function.
The for
statement is a tool to traverse things containing items.
Strings, lists, and ranges are things containing items,
so you can use a for
to iterate their elements, like:
1 2 3 4 5 6 7 8 |
|
Or like:
1 2 3 4 5 6 7 |
|
Or:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
There's no corrections yet, hit the `Submit` button to send your code to the correction bot.
Keyboard shortcuts:
- Ctrl-Enter: Send your code to the correction bot.
- Escape: Get back to the instructions tab.