demo_string_formatting2.py:
price = 49 txt = "The price is {:.2f} dollars" print(txt.format(price))
➜ begtut>python demo_string_formatting2.py
The price is 49.00 dollars