Need help on; Exercise 5

Hi All, looks like I’m stuck here. I don’t see anything wrong on my code but not sure why Python sees an error.

I tried the following but no luck;

  • rewrite the code
  • tried to put a # on line 9, but it sees error on line 10
  • Still looking an answer on google, but in the meantime, can you help check this please.


My guess is your problem is at line 8 or above.
Please put up your code if you don’t find the reason on your own.

1 Like

@ntorres you are running the command:


which will probably be using version 2.6 or something.

Try using the version 3 of python as per Zed’s example:


f-strings were introduced in python 3 so if you are using an older version of python, it will not recognise the syntax:

print(f"some string with f at the front and a {variable} too.")

Hey @ntorres, @gpkesley already gave you the best action but you want to do this:

python --version

If it says 2.7 then you need to run python 3.6 or 3.7. You can do that with either:


Try all of those.

Hi gpkesley, zedshaw, Ulfen69,

Yeah It works when I ran python3 my bad, I was get used to running python as it was working on previous exercises. Thanks so much for your help.

Me too. I do that all the time.