I was wondering how to have a price total in this code.
As you can see, the code repeats as is necessary so I was wondering how to add up a total if there is only on price variable.
times = int(input('How many items on your shopping list? '))
def question(times):
grocery_list = {}
print
print ('Enter grocery item and price.')
print
for i in range(times):
key = input('Item %d Name: ' % int(i+1))
value = input('Item %d Price: $' % int(i+1))
print
grocery_list[key] = value
print (grocery_list)
question(times)