Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shopping_list = []
- cost_list = []
- sum = 0
- total = 0
- how_many = input("How many items of shopping are needed ? ")
- how_many = int(how_many)
- for items in range (how_many):
- items = input(" what is the item " + str(items +1 ) + " ? ")
- item_cost = input (" what is the cost = " )
- shopping_list.append(items)
- cost_list.append(item_cost)
- sum = sum + int(item_cost)
- average = sum/how_many
- print (shopping_list)
- print (cost_list)
- print (" I have " + str(len(shopping_list)) + " items in my shopping list")
- print ("Total cost = " + str(sum))
- print("Average_cost = " + str(sum)+ "/" + str(how_many) +" =" + str(average))
- discount = input(" How many discount to be applied = " )
- discount = int(discount)
- total = sum*(100-discount)/100
- print ("Total with discount = " + str(total) + " Euros")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement