In: Computer Science
Your order from store Your orders are 10 chips You purchased a total of 10 chips with a total price of $90 5 gums You purchased a total of 5 gums with a total price of $30 Question: Please create a code to allow you to remove one or more of your orders (in python3 language)
Here Iam providing the code and the output for the given problem in python
Code
Sample output
Sample output
Code
chips_purchased = 10
chips_price_each = 9 #From given input
gums_purchased = 5
gum_price_each = 6
remove = int(input("Enter no of items you want to remove from chips
: ")) #taking input for removing chips
if(remove > 0 and remove <= chips_purchased):
chips_purchased = chips_purchased - remove
else:
print("Cannot remove available chips are",chips_purchased)
remove = int(input("Enter no of items you want to remove from
gums : ")) #taking input for removing gums
if(remove > 0 and remove <= gums_purchased):
gums_purchased = gums_purchased -remove
else:
print("Cannot remove available gums are",gums_purchased)
print("\nThe total amount for chips :$",chips_purchased *
chips_price_each) #printing out the bill
print("The total amount for gums
:$",gums_purchased*gum_price_each)