Created
March 16, 2016 15:29
-
-
Save mattseymour/a14b93f33454db1c8a30 to your computer and use it in GitHub Desktop.
A small script to calculate energy costs per year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cost per units and standard day charge | |
ELEC_PKWH = 12.2 | |
ELEC_DAILY = 11.420 | |
GAS_PKWH = 2.973 | |
GAS_DAILY = 12.910 | |
# Number of units i use | |
ELEC_USAGE = 4000 | |
GAS_USAGE = 8000 | |
def standing_charge(ppd): | |
return (ppd*365) / 100 | |
def cost_for_x_units(units, ppkwh): | |
return (units * ppkwh) / 100 | |
if __name__ == '__main__': | |
elec_sc = standing_charge(ELEC_DAILY) | |
gas_sc = standing_charge(GAS_DAILY) | |
elec_kwh = cost_for_x_units(ELEC_PKWH, ELEC_USAGE) | |
gas_kwh = cost_for_x_units(GAS_PKWH, GAS_USAGE) | |
print 'Gas: --------------------' | |
print 'Standing charge:', gas_sc | |
print 'PKW hour', gas_kwh | |
print 'Yearly total:', gas_kwh + gas_sc | |
print 'Elec: -------------------' | |
print 'Standing charge:', elec_sc | |
print 'PKW hour', elec_kwh | |
print 'Yearly total:', elec_kwh + elec_sc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment