A short script to calculate the daily/monthly/annual costs from an hourly cost value (Useful for AWS bill calculation!) printing the resulting cost in GBP.
#!/usr/bin/python # -*- coding: utf-8 -*- # Ask for Hourly Cost cost = float(input("What is the Hourly cost? ")) # Calculate Costing daily=float(cost*24) annually=float(daily*365) monthly=float(annually/12) # Print Results print "Costing based on hourly cost of £%.2f" % cost + " is:" print "Daily: £%.2f" % daily print "Annually: £%.2f" % annually print "Monthly: £%.2f" % monthly