Search code examples
pythonpython-3.xf-string

Why is that Python 3 IDE in some sites doesn't support f string function?


f string function

print(f"{theString}")

makes it easier to print the string than this

print("{}".format(theString))

But Python 3 compiler in certain sites doesn't support this function. Is there some specific version of Python for this function to support this.

Edit: Hackerrank.com like some other sites just mention it as Python 3 or 2 and no specific version

image


Solution

  • Python 3.6 introduced f-strings. Any python version 3.6 or higher will support this feature.