-2
def __str__(self):
    return f"{self.name}({self.age})"  

I don't understand it, What is the means of "f" in this return function

iBug
  • 35,554
  • 7
  • 89
  • 134

1 Answers1

0

It is called an format string. Briefly - Formatted strings are to address some of the shortcomings other methods for formatting strings had

some differences between f.string and format()