SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
Python error · Python 3
The notebook was written for Python 2, where print was a statement: print "total:", total. In Python 3 it’s a function and needs parentheses. Because Python reads the whole cell before running it, not even the lines above the print run.
Why it happens
Python 2 reached its end of life in January 2020, but many course notebooks, books and Kaggle kernels were written for it. One print without parentheses is enough to stop the whole cell.
How to fix it
Add parentheses. A trailing comma, which kept Python 2 on the same line, becomes end=' ', and print >>f, x becomes print(x, file=f):
Before
total = 42
print "total:", total
for name in ["a", "b"]:
print name,
After
total = 42
print("total:", total)
for name in ["a", "b"]:
print(name, end=' ')
Other Python 2 lines are fixed the same way: except ValueError, e: → except ValueError as e:, xrange → range, raw_input → input.
In NoteRun
NoteRun checks a notebook before you run it and marks the cells that would stop. Fix all changes every Python 2 print, except, xrange and raw_input in the notebook in one tap. Nothing changes until you tap, you see every change first, and Undo brings the notebook back.
On your iPhone or iPad, download a sample notebook that has this error and open it in NoteRun.