Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the amount entered is less than the total cost of the two items, print a message that states how much is still owed. Otherwise, print a thank you message and state how much change will be given. Input Format Prompts: "Enter price of item 1 " "Enter price of item 2 " "Enter amount of payment " Sample input 1: 1.50 2.25 5.00 Sample input 2: 7.50 2.25 5.00 Constraints
Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the amount entered is less than the total cost of the two items, print a message that states how much is still owed. Otherwise, print a thank you message and state how much change will be given.
Input Format
Prompts: "Enter price of item 1 "
"Enter price of item 2 "
"Enter amount of payment "
Sample input 1:
1.50
2.25
5.00
Sample input 2:
7.50
2.25
5.00
Constraints
Input will be a number with two decimal places. Output must be displayed with two decimal places.
Output Format
Sample output 1:
Thank you! Change = 1.25
Sample output 2:
Still owed = 4.75
Sample Input 0
Sample Output 0
Sample Input 1
Sample Output 1
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images