>>> format_string=("%2f" %13.333222) >>> print(format_string) 13.333222 >>> format_string=("%2.3f" %13.333222) >>> print(format_string) 13.333
>>> name = "AAA" >>> age = 5 >>> '%s is %d years old.' % (name, age) 'AAA is 5 years old.' >>> "{} is {} years old.".format(name, age) 'AAA is 5 years old.' >>> f'{name} is {age} years old.' 'AAA is 5 years old.'