Your output looks correct apart from the whitespace. DIFF SPLIT DIFF YOUR OUTPUT EXPECTED Welcome to Krusty Burgers! Krusty Burger $ 5.10 Milkshake $ 3.50 Krusty Meal Set[Burger + Drink + Krusty Laugh] $10.50 Enter order for Krusty Burger: 1 Enter order for Milkshake: 1 Enter order for Krusty Meal Set[Burger + Drink + Krusty Laugh]: 1 Order Summary Krusty Burger 5.10 x 1 Milkshake $ 3.50 X 1 Krusty Meal Set[Burger + Drink + Krusty Laugh] $ 10.50 x 1 Sub-total 19.10 + Sub-total $ 19.10 GST $ 0.96 Total $ 20.06 + Total $ 20.06 +
print("Welcome to Krusty Burgers!")
print(f"{'Krusty Burger' : <49}{'$ 5.10' : <5}")
print(f"{'Milkshake' : <49}{'$ 3.50' : <5}")
print(f"{'Krusty Meal Set[Burger + Drink + Krusty Laugh]' : <49}{'$10.50' : <5}")
qt1 = int(input("\nEnter order for Krusty Burger: "))
qt2 = int(input("Enter order for Milkshake: "))
qt3 = int(input("Enter order for Krusty Meal Set[Burger + Drink + Krusty Laugh]: "))
price1 = qt1*5.10
price2 = qt2*3.50
price3 = qt3*10.50
print("\nOrder Summary")
print(f"{'Krusty Burger' : <49}{'$ 5.10 x ' : <7}", end = "")
print(f"{qt1 : <1}")
print(f"{'Milkshake' : <49}{'$ 3.50 x ' : <7}", end = "")
print(f"{qt2 : <1}")
print(f"{'Krusty Meal Set[Burger + Drink + Krusty Laugh]' : <49}{'$ 10.50 x ' : <7}", end = "")
print(f"{qt3 : <1}")
Sub_total = price1+price2+price3
GST = 0.05 * Sub_total
Sub_total_1 = "{:.2f}".format(Sub_total)
GST_1 = "{:.2f}".format(GST)
Total = float(Sub_total_1) + float(GST_1)
print(f"{'Sub-total' : <49}{'$' : <3}", end = "")
x = "{:.2f}".format(Sub_total)
print(f"{x : <3}")
print(f"{'GST' : <49}{'$' : <3}", end = "")
x = "{:.2f}".format(GST)
print(f"{x : <3}")
print(f"{'Total' : <49}{'$' : <3}", end = "")
x = "{:.2f}".format(Total)
print(f"{x : <3}")
This code gives me the right out put for the setting out of the program that is wrong with the templates. How can I fix it? The picture: the green one is what the program expect to be, the red one is what the code produce. It fail 3/5 templates.
Step by step
Solved in 2 steps with 1 images