-4

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

Granny Aching
  • 1,175
  • 7
  • 33
abhijithvijayan
  • 752
  • 10
  • 15

1 Answers1

3

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

R.F. Nelson
  • 2,036
  • 2
  • 10
  • 23