TORONTO KIDS COMPUTER CLUB | PMCA Sunday 14:00 Python Homework 20.02.23.
17144
post-template-default,single,single-post,postid-17144,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

PMCA Sunday 14:00 Python Homework 20.02.23.

28 Feb PMCA Sunday 14:00 Python Homework 20.02.23.

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.