demo_string_formatting3.py:
quantity = 3 itemno = 567 price = 49 myorder = "I want {} pieces of item number {} for {:.2f} dollars." print(myorder.format(quantity, itemno, price))
➜ begtut>python demo_string_formatting3.py
I want 3 pieces of item number 567 for 49.00 dollars.