Ask coding questions

← Back to all posts
The version of python not showing
ak8782 (0)

Why is my version of python not showing?

Also, why is this piece of code showing an error?
The f function for formatted strings isnt working.. but the old version .format function works just fine..
is my python not upgraded on repl? Please advise

Comments
hotnewtop
Coder100 (18089)

please read the text always shown at the top of your terminal to locate what version is being used by default.

Anyways your problem is you added a space.
You aren't supposed to do that for the delim

name = 'A'
age = 34
print(f'hello {A}.\n You are {34} years old.')
OldWizard209 (1504)

You have an extra space after the "f". remove it:

name = 'A'
age = 34
print(f'hello {A}.\n You are {34} years old.')

And the python version is shown in the console.

AarjavKavathia (5)

You need to add quotes in between the braces, like "A" and "34"..

BearCoder01 (8)

Yes it is showing. It's Python 3.8.2