#set the variables
amount = 0
money_saved = 0
total_cost = 0
price = input("Enter the price of the bread until entered you entered 0: ")
#while statement
while price > 0:
total_cost = total_cost + price
amount +=1
price = input("Enter the price of the bread untiled you entered 0: ")
if amount < 3:
total_off = total_cost * (1- amount * 0.1)
#if the amount of the bread is more than 3
else:
total_off = total_cost * 0.7
money_saved = total_cost - total_off
#print the total cost, and money saved
print "Total cost after the discount is: ", total_off
print "You saved: ", money_saved
0