What causes a Python syntax error?

I am completely new to Python, and I am trying to start my server, but I get this syntax error from the project I'm working on.

    def find_shortest_path(start: GraphNode, end, path=[]):
                                ^
SyntaxError: invalid syntax

To be clear, I did not write the code, I just need to stylize the project, but I don’t know how else to see the application without running it on the server.

+4
source share
1 answer

This code apparently uses function annotations that are only available in Python 3.X.

What version of Python are you using?

+7
source

Source: https://habr.com/ru/post/1609207/


All Articles