Write a program to enter the price and display discount percentage using ELSEIF statement. (5) If price>=5000, 20% discount If price>=3000, 15% discount If price>=2000, 10% discount If price>=1000, 5% discount

Respuesta :

Answer:

Explanation:

The following code is written in Python and creates a function that takes in the price as a parameter and then returns the discount amount to the user as well as printing it to the screen.

def discountAmount(price):

   discount = 0

   if price >= 5000:

       discount = 20

   elif price >= 3000:

       discount = 15

   elif price >= 2000:

       discount = 10

   elif price >= 1000:

       discount = 5

   else:

       discount = 0

   print("Your total discount is " + str(discount) + "%")

   return discount

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE