[Tutor] python tutorial issue

Christopher Loy chrisloy9829 at gmail.com
Sun Oct 18 11:42:00 EDT 2020


I’m currently on mac with python running python in terminal going through the tutorial off of the website python.org.   https://docs.python.org/3/tutorial/controlflow.html  on the control flow of the python part 4.6 doing the example every time I try to do the example on python part of the terminal I’m getting a Syntaxerror:  invalid syntax  on the  equals sign on print on line 5 of the code.  I could not figure out the issue trying different ways of typing but i have it typed as so

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=‘ ‘)

after I hit enter for this line it gives me a syntax error on the equals sign…. What could I be doing wrong.  Please help thank you.  

Christopher Loy


More information about the Tutor mailing list