27 Feb Aurora Saturday 16:30 Python Homework 20.02.22.
Question:
A store is having a sale. If the customer purchased 10 dollars or more, the store will give $2 off. Please write a program to ask how much the customer has bought. The program will show the discount and the final price the customer has to pay.
Input specification:
Use input() function to show the question prompt “Price: ” then wait for your answer.
Output Specification:
Use print() function to show “You got $2 discount and your final price is …” if you enter the answer from the input is 10 or above. Otherwise, it will show “You did not get any discount and your price is …”
Sample Input 1:
Price: 20
Sample Output 1:
You got $2 discount and your final price is 18
Sample Input 2:
Price: 8
Sample Output 2:
You did not get any discount and your price is 8
Sorry, the comment form is closed at this time.