Southern New Hampshire University Debugging Reflection Paper What is important is developing the skill of learning how to understand your errors and then fix them (debugging). Explain the importance of knowing how and when to use lists, dictionaries, and loop types. Support your response with examples from the sample code below:
Two simple paragraphs.
# grocery_item
grocery_item = dict()
# grocery_history
grocery_history = list()
# go
go = True
# loop till go is true
while go:
# take input for item_name, quantity,cost
item_name = input(“Item name:n”)
quantity = int(input(“Quantity purchased:n”))
cost = float(input(“Price per item:n”))
# update grocery_item with new data
grocery_item = {‘name’:item_name, ‘number’: int(quantity), ‘price’: float(cost)}
# append to list
grocery_history.append(grocery_item)
# ask user again for input
dt = input(“Would you like to enter another item?nType ‘c’ for continue or ‘q’ to quit:n”)
if dt == “q”:
go = False # if q set go to False
grand_total = 0.0 # declare grand total
for each in grocery_history:
item_total = each[‘price’]*each[‘number’] # cal item_total
# print details
print(str(each[‘number’]) +” “+str(each[‘name’]) + ” @ $” +str(‘%.2f’ % each[‘price’])+” ea $” + str(‘%.2f’ % item_total))
# add item_total to grand_total
grand_total = grand_total + item_total
item_total = 0.0 # set item_total to 0
print(“Grand total: $”+ str(‘%.2f’ % grand_total))
Science is the pursuit and application of knowledge and understanding of the natural and social…
Clearly stating the definition, the values, the meaning of such values and the type of…
All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…
All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…
https://www.npr.org/sections/ed/2018/04/25/605092520/high-paying-trade-jobs-sit-empty-while-high-school-grads-line-up-for-university Click on the link above. Read the entire link and answer the questions below…
All answered must be typed using Times New Roman (size 12, double-spaced) font. No pictures…