def __str__(self):
return f"{self.name}({self.age})"
I don't understand it, What is the means of "f" in this return function
def __str__(self):
return f"{self.name}({self.age})"
I don't understand it, What is the means of "f" in this return function
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()