Hi try this
I assume you are initailising all variables to zero
abun = 0
acoffee=0
acake=0
asandwich=0
adessert=0
nbun=0
ncake=0
ncoffee=0
nsandwich=0
ndessert=0
while True:
item = raw_input("Which item would you like to buy?")
if item == 'bun':
abun = abun + 0.50
nbun += 1
elif item == 'coffee':
acoffee = acoffee + 1.20
ncoffee += 1
elif item == 'cake':
acake = acake + 1.50
ncake += 1
elif item == 'sandwich':
asandwich = asandwich + 2.10
nsandwich += 1
elif item == 'dessert':
adessert = adessert + 4.00
ndessert += 1
user_input = raw_input('type yes to continue and end to terminate:')
if user_input == 'end':
break
total = abun + acoffee + acake + asandwich + adessert