Plutonic Rainbows

Percentage Calculator

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)