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
- Filter First, Think Later February 21, 2026
- Five Hundred Bugs That Fuzzers Missed February 20, 2026
- Gemini 3.1 Pro and the 0.1 That Matters February 19, 2026