Learn
Loops
While you're at it
Inside a while
loop, you can do anything you could do elsewhere, including arithmetic operations.
Instructions
1.
Create a while
loop that prints out all the numbers from 1 to 10 squared (1, 4, 9, 16, … , 100), each on their own line.
- Fill in the blank space so that our
while
loop goes from1
to10
inclusive. - Inside the loop, print the value of
num
squared. The syntax for squaring a number isnum ** 2
. - Increment
num
.