PRODUCT PRICE CALUCULATOR AFTER DISCOUNT :
calculate the final price after discount.
Explanation
You have write code for the to get final price when discount percentage remove from original price. the program should then calculate and display the product final price after applying the discount.
product original price and discount
final price
Expected Output :
Example
product price original price 10000
discount price percentage 15%
final price after 10% discount is 8500
code for price calculator
Code :
# Step 1: Get user input
product_name = input("Enter the product name: ")
original_price = float(input("Enter the original price
(in ₹): "))
discount_percent = float(input("Enter the discount
percentage (%): "))
# Step 2: Calculate discount and final price
discount_amount = (discount_percent / 100) * original_price
final_price = original_price - discount_amount
# Step 3: Show the results
print("\n--- Price Details ---")
print("Product:", product_name)
print("Original Price: ₹", round(original_price, 2))
print("Discount:", discount_percent, "%")
print("Discount Amount: ₹", round(discount_amount,
2))
print("Final Price After Discount: ₹", round(final_price,
2))
output ;
Enter the product name: phone
Enter the original price (in ₹): 10000
Enter the discount percentage (%): 15
--- Price Details ---
Product: phone
Original Price: ₹ 10000.0
Discount: 15.0 %
Discount Amount: ₹ 1500.0
Final Price After Discount: ₹ 8500.0
Percentage Calculation
in simple form
200 rupees product with 10 % discount how much you saved. in python to find 10 % of 200 , simply divide 10 / 100 and then multiply this by 200, like this 10/100*200.
Code
print(10/100*200)
Output
20
- You have to must try in your python compiler use idle avoid online compilers to Errors
- Quiz about Arithmetic Operations In Python
0 Comments