I'm working my way through the python tutorial here and the following code is used as an example.
>>> def fib(n): # write Fibonacci series up to n
... """Print a Fibonacci series up to n."""
... a, b = 0, 1
... while a < n:
... print(a, end=' ')
... a, b = b, a+b
... print()
...
>>> # Now call the function we just defined:
... fib(2000)
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
When I run it in the Canopy editor though I get the following error message
File "<ipython-input-25-224bab99ef80>", line 5
print(a, end=' ')
^
SyntaxError: invalid syntax
The syntax is the same across PyLab, using python in the command prompt, and the Canopy Editor so I can't see why it wouldn't just run...