Percentage Calculator
February 27, 2018
This script will ask you to enter your amount and the percentage to be deducted before finally giving you the new amount.
# -*- coding: utf-8 -*-
def percentage(input_sum, divide, calc):
return input_sum / divide * calc
def reduction(input_sum, answer):
return input_sum - answer
input_sum = float(raw_input("\nEnter sum total: "))
calc = float(raw_input("\nEnter Percentage: "))
answer = percentage(input_sum, 100, calc)
reduction_total = reduction(input_sum, answer)
print "\nYou are left with £{0:.2f}\n".format (reduction_total)
Related Entries
- Salary Calculator 2 March 4, 2019
- Loan Calculator February 11, 2018
- Salary Calculator February 27, 2019