Stuck On Searchcademy

Link to project:
https://www.codecademy.com/courses/search-algorithms/projects/searchcademy
Why is there an error:


?

f-string is python 3.6+, so I think that is the problem

2 Likes

But I tested my code again on a file called test.py and it ran and it worked even though the file imported stuff from script.py which caused the error on the above picture.

you could run your cod with python3 -c "..."

1 Like

Yes that’s good. The project asked be to use this format:
python -c "..."
. Why does the project ask me to do that?

according to python --help:

-c cmd : program passed in as string (terminates option list)

Not an option I would use very quickly, but might be an easy way to test different lists?

I’m might not test it because I don’t need to(It’s working fine) and I’ve finished the project.

The reason it didn’t work was because python -c uses the system’s default Python interpreter, which in the case of this project is probably Python 2. calling python3 -c specifically calls a Python 3 interpreter, which would work. This is a Codecademy bug and should be reported using the built-in bug report feature.

1 Like