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)
Recent Entries
- Wonder 2 Finally Shows Some Restraint January 25, 2026
- Forty-Five Bugs Hiding in Plain Sight January 23, 2026
- Cleaning the Metadata January 21, 2026