I have tried
totalValue = 0 bagsChecked = 0
for x in range(len(volunteerList)):
record = volunteerList[x]
if record[1] == "1 pence":
amount = 1.00
elif record[1] == "2 pence":
amount = 1.00
elif record[1] == "5 pence":
amount = 5.00
elif record[1] == "10 pence":
amount = 5.00
elif record[1] == "20 pence":
amount = 10.00
elif record[1] == "50 pence":
amount = 10.00
elif record[1] == "1 pound":
amount = 20.00
else:
amount = 20.00
totalValue = totalValue + amount
bagsChecked = bagsChecked + 1
print("Bags checked: ",bagsChecked)
print("Total Value: ",totalValue)'''
Is there a way that I can fix this so that it displays an accurate number of bags checked and total value.
Aucun commentaire:
Enregistrer un commentaire