As You see at the 2 pics the iteration loop works well with canopy but with IDLE Python 2.7.10 says: Syntax error
Why?
As You see at the 2 pics the iteration loop works well with canopy but with IDLE Python 2.7.10 says: Syntax error
Why?
It looks to me like IDLE was confused by how you entered multiple statements. You need to enter a blank line after the indented suite of the while loop so it knows the statement is over (and that there's not an else
block attached). You'll know you've finished the statement when the >>>
prompt appears again.
>>> while ...
# stuff here
# more stuff
# leave a blank line afterwards!
>>> print ('Goodbye!')
Your code would work just fine in IDLE if you put it into a module and ran the module. It's only the interactive console that has issues.