-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,295
  • 12
  • 37
abhijithvijayan
  • 835
  • 12
  • 17

1 Answers1

3

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

R.F. Nelson
  • 2,254
  • 2
  • 12
  • 24