I started learning python the other day. I have a fibonacci function that I copied from python docs. It gives a syntax error on the print statement with the end=''
I rewrote all the code manually and still i get the error
def fibonacci2(n):
a, b = 0, 1
while b < n:
print(b, end=' ')
a, b = b, a+b
print()
It says syntax error while detecting tuple
Thanks in advance
edit: i am sorry that i forgot to write, i am using python 3.
from __future__ import print_functionatop the file (or upgrade to Python 3).