This is Samreen Fatima from Educative.
In order to correct your code, consider the following:
- Add the multiplication operator between the price and the following number, i.e. price * 20 instead of price20.
- Store the discounted price in the price variable as mentioned in the lesson:
price variable has already been created. You can use it in your code and assign it a new value based on the discount.”
This helps us to evaluate your newly calculated price.
The correct version of your code is as follows:
price = price - (price*30/100)
elif (price>=200 and price<300):
price = price - (price*20/100)
elif (price>=100 and price<200):
price = price - (price*10/100)
elif (price>=0 and price<100):
price = price - (price*5/100)
Samreen Fatima | Developer Advocate