Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is causing this Python syntax error?

Tags:

python

django

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.

like image 718
Justus Eapen Avatar asked Mar 14 '23 16:03

Justus Eapen


1 Answers

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

What version of Python are you using?

like image 111
jaynp Avatar answered Apr 01 '23 04:04

jaynp