4

I'm totally new to Python, and I'm trying to run my server but I'm getting 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 didn't write the code, I'm just supposed to style the project but I don't know how else to see the app without running it in the server.

1 Answer 1

7

This code appears to be using function annotations which are only available in Python 3.X.

What version of Python are you using?

Sign up to request clarification or add additional context in comments.

4 Comments

I'm using...Python 2.7.10 (when I run python -V) I don't know what version the app uses?
@JustusEapen can you provide more information about what app it is? I suspect if you install python3 and use that to start the django app, it will work.
installing Python 3 on my machine? I can give you more details on the app offline if you have time...
Ok I'm installing python3. Thanks all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.