Loop incremental


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
num = 1
while num <= 10
print num ** 2
num = num +1.

<What do you expect to happen instead?>
My question is that i know num = num + 1 can also be written as num+=1. When i used the num+=1, it did not work.Why?

```python

Replace this line with your code.

<do not remove the three backticks above>

#2

please post your attempt of num+=1 (the full code) using format:

so indent shows


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.