TORONTO KIDS COMPUTER CLUB | Aurora Saturday 13:00 Python Practice 20.07.04.
17858
post-template-default,single,single-post,postid-17858,single-format-standard,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Aurora Saturday 13:00 Python Practice 20.07.04.

08 Jul Aurora Saturday 13:00 Python Practice 20.07.04.

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
No Comments

Sorry, the comment form is closed at this time.