3. While you're at it



File "python", line 7
SyntaxError: invalid syntax

Can't I type num++ instead of num+=1?

num = 1

while num<11:  # Fill in the condition
    # Print num squared
    print num**2
    # Increment num (make sure to do this!)


That's not a valid way of writing in Python, so yes you have to use the other method.


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