-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathday7.py
More file actions
20 lines (11 loc) · 677 Bytes
/
day7.py
File metadata and controls
20 lines (11 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#Write a Python program that calculates and displays discounts for a shopping cart. The program should do the following:
# Ask the user to enter the total cost of their shopping cart.
# Check if the total cost is greater than or equal to $50. If it is, apply a 10% discount to the total cost. If not, no discount is applied.
# Display the original total cost and the discounted total cost (if a discount is applied) to the user.
total=int(input("Please enter your total cost: "))
if total>=50:
new_total=total- (0.001 * total)
print("Your discount is:",new_total,"$")
print("The original total is: ",total,"$")
else:
print("The total is: ",total,"$")