3. While you're at it


#1



https://www.codecademy.com/courses/python-beginner-en-cxMGf/0/3?curriculum_id=4f89dab3d788890003000096#

File "python", line 7
num++
^
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!)
    num++


#2

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


#3

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