This is a Python program that calculates discount amount and discounted rate for which you get the product for sale.
Variables Used:- price: Actual price of the product.
- discount_percentage: Datatype float : Discount % on the product.
- discount_amount: Datatype float : Discount Amount on the product.
- discounted_price: Datatype float : Discounted price that you pay.
Discount Amount = (Discount Percentage x Price)/100
Discounted Price = Price - Discount Amount
Sample Program code: discountCalculator.py
price = 1000;
discount_percentage = 5.99;
discount_amount = 0;
discounted_price = 0;
discount_amount = (discount_percentage*price)/100;
discounted_price = (price-discount_amount);
print("Discount Amount: ", discount_amount);
print("Discounted Price: ", discounted_price);
Output:
Discount Amount: 59.9
Discounted Price: 940.1
More Posts related to Python,
- How to Install Python Modules in VS Code
- 3 Python program to add two numbers
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- Python: How to get Current Directory
- Python - Convert float to String
- Tkinter - add x and y padding to label text
- Check if String Contains a Substring - Python
- Read JSON File in Python Program
- How to Convert String to DateTime in Python
- Sorting an array using Bubble Sort in Python Programming
- Python Hello World! Program with code example (snippet)
- How to delete a dir or folder using Python code
- Change label (text) color in tkinter
- Set width and height for the label in tkinter
- Check version of pip package installer for Python
- Reading JSON file in Python with Examples
- Indent Python code in Notepad++
- tkinter - Hello World! Program
- How to resolve Failed to create interpreter PyCharm Error
- Base64 Encoding Decoding in Python Programming
- How to pip install Python Modules in VSCode
- How to take user input from the console in a Python program
- Take input argument from command line in Python Programming
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- Calculate discount amount python code
More Posts:
- Read file from resources folder in Java project code - Java
- How to pass value to another Power Apps screen - PowerApps
- Prettify JSON in Notepad++ - NotepadPlusPlus
- How to add sleep in Powershell Script - Powershell
- airbnb website and mobile App is down worldwide - clear browser cache or reinstall app to fix error - News
- 86 Gmail keyboard shortcuts that you may find Advantageous - Google
- How to check if Java main thread is alive - Java
- Adding Sub Headings to Bootstrap Header tags - Html