Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1585

Python • Re: SyntaxError: invalid syntax ---> "

$
0
0
Python 3.5.3 (default, Nov 4 2021, 15:29:10)
That's likely your problem right there. Python f-strings didn't exist until Python 3.6

The error marker '^' is probably way off to the right because of invisible trailing spaces in the source code copied.

Try replacing the print with -

Code:

print("{} equals {} * {}".format(n, x, n // x))

Statistics: Posted by hippy — Thu Oct 23, 2025 1:15 pm



Viewing all articles
Browse latest Browse all 1585

Trending Articles