Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- print "Running as Main!"
- tariff = raw_input("Plese name your tariff: ")
- billfunctions(tariff)
- if __name__== "__main__":
- main()
- def billfunctions(tariff):
- if tariff == "LT-I"
- readings = calcLTI_input()
- consumption =final_read-intial_read
- total_cost = calcLTI(consumption, con_type)
- print (total_cost)
- def calcLTI_iput():
- consumption = int(raw_input("If you know the exact consuption, please enter the value and leave other two entires empty, else leave this empty") or "0")
- init_read = int(raw_input("Please enter the intial reading") or 0)
- final_read = int(raw_input("Please enter the final reading") or 0)
- type_of_conction = int(raw_input("Please enter 3 for 3Phase connection and 1 for single phase leaving empty will be traseted as signle phase connection") or 1)
- readings = [consumption, init_read, final_read, type_of_conction]
- return readings
- #1 ############### LT-I ####################
- #A Two part tariff is for house hold cosumers#
- def calcLTI(consumption, con_type):
- # fixed cost calculation for LT-I
- if con_type == 1:
- fixed_cost = 30;
- elif con_type == 3:
- fixed_cost = 80;
- else:
- print("Type of connection does not exists")
- # Energy cost calculation for LT-I
- if consumption < 250: # telescopic range
- if consumption < 51:
- energy_cost = consumption*2.9
- elif consumption <101:
- energy_cost = 145+(consumption-50)*3.4
- elif consumption <151:
- energy_cost = 145+170+(consumption-100)*4.5
- elif consumption <201:
- energy_cost = 145+170+225+(consumption-150)*6.10
- else:
- energy_cost = 145+170+225+305+(consumption-200)*7.3
- elif consumption > 250:
- if consumption < 300:
- energy_cost = consumption*5.5
- elif consumption <350:
- energy_cost = consumption*6.2
- elif consumption <400:
- energy_cost = consumption*6.5
- elif consumption <500:
- energy_cost = consumption*6.7
- else:
- energy_cost = consumption*7.5
- return energy_cost+fixed_cost
- #2 ############### LT-IV(A) ####################
- #A Two part tariff is for industrial cosumers#
- #general purpose industrial loads (single or three phase)#
- def calcLT_IVA(consumption, connected_Load):
- # fixed cost calculation for LT-IV(A)
- if connected_Load < 10:
- fixed_cost = connected_Load*100
- elif connected_Load > 20:
- fixed_cost = connected_Load*60
- else
- fixed_cost = connected_Load*125
- # Energy cost calculation for LT-IV(A)
- energy_cost = consumption*5.2
- return energy_cost+fixed_cost
- #3 ############### LT-IV(B) ####################
- #A Two part tariff is for industrial cosumers#
- #IT enabled industrial loads (single or three phase)#
- def calcLT_IVB(consumption, connected_Load):
- # fixed cost calculation for LT-IV(B)
- if connected_Load < 10:
- fixed_cost = connected_Load*100
- elif connected_Load > 20:
- fixed_cost = connected_Load*60
- else:
- fixed_cost = connected_Load*125
- # Energy cost calculation for LT-IV(B)
- energy_cost = consumption*5.8
- return energy_cost+fixed_cost
- #4 ############### LT-V(A) ####################
- #A Two part tariff is for industrial cosumers#
- #Agricultaral purpose loads (single or three phase)#
- def calcLT_VA(consumption, connected_Load):
- # fixed cost calculation for LT-V(A)
- fixed_cost = connected_Load*8
- # Energy cost calculation for LT-V(A)
- energy_cost = consumption*2
- return energy_cost+fixed_cost
- #5 ############### LT-V(B) ####################
- #A Two part tariff is for industrial cosumers#
- #Agricultaral purpose, anifarming famring sector loads (single or three phase)#
- def calcLT_VB(consumption, connected_Load):
- # fixed cost calculation for LT-V(B)
- fixed_cost = connected_Load*8
- # Energy cost calculation for LT-V(B)
- energy_cost = consumption*2.5
- return energy_cost+fixed_cost
- #6 ############### LT-VI(A) ####################
- #A Two part tariff is for industrial cosumers#
- #Goverment or Aided institutions (single or three phase)#
- def calcLT_VIA(consumption, connected_Load):
- # fixed cost calculation for LT-VI(A)
- fixed_cost = connected_Load*50
- # Energy cost calculation for LT-VI(A)
- if consumption < 500:
- energy_cost = consumption*5.5
- else:
- energy_cost = consumption*6.3
- return energy_cost+fixed_cost
- #7 ############### LT-VI(B) ####################
- #A Two part tariff is for industrial cosumers#
- #Self finacing or autonmus institutions (single or three phase)#
- def calcLT_VIB(consumption, connected_Load)
- # fixed cost calculation for LT-VI(B)
- fixed_cost = connected_Load*70
- # Energy cost calculation for LT-VI(B)
- if consumption < 500:
- energy_cost = consumption*6.3
- else:
- energy_cost = consumption*7.0
- return energy_cost+fixed_cost
- #8 ############### LT-VI(C) ####################
- #A Two part tariff is for industrial cosumers#
- #Central goverment institutions (single or three phase)#
- def calcLT_VIC(consumption, connected_Load):
- # fixed cost calculation for LT-VI(C)
- fixed_cost = connected_Load*180
- # Energy cost calculation for LT-VI(C)
- if consumption < 500:
- energy_cost = consumption*7.0
- else:
- energy_cost = consumption*8.5
- return energy_cost+fixed_cost
- #9 ############### LT-VI(D) ####################
- #A Two part tariff is for industrial cosumers#
- #Orphanages and anganwadies#
- def calcLT_VID(consumption, con_type):
- # fixed cost is zero
- # Energy cost calculation for LT-VI(D)
- energy_cost = consumption*1.8
- if con_type == 3:
- if energy_cost< 25:
- energy_cost = 25
- if con_type == 1:
- if energy_cost< 15:
- energy_cost = 15
- return energy_cost
- #10 ############### LT-VI(E) ####################
- #A Two part tariff is for industrial cosumers#
- #Other goverment institutions, whose connected load below 2000W #
- def calcLT_VIE(consumption, con_type):
- # fixed cost calculation for LT-IV(E)
- if con_type == 1:
- fixed_cost = 20
- elif con_type == 3:
- fixed_cost = 60
- else :
- print("Type of connection does not exists")
- # Energy cost calculation for LT-IV(E)
- if consumption < 50:
- energy_cost = consumption*2.8
- elif consumption <120:
- energy_cost = consumption*3.8
- elif consumption <200:
- energy_cost = consumption*4.5
- else:
- energy_cost = consumption*6.3
- return energy_cost+fixed_cost
- #11 ############### LT-VI(F) ####################
- #A Two part tariff is for industrial cosumers#
- #Private hospitals and clinics #
- def calcLT_VIE(consumption, connected_Load, con_type):
- # fixed cost calculation for LT-VI(F)
- if con_type == 1:
- fixed_cost = 60
- elif con_type == 3:
- fixed_cost = 120
- else :
- print("Type of connection does not exists")
- # Energy cost calculation for LT-VI(F)
- if consumption < 100:
- energy_cost = consumption*5.8
- elif consumption <200:
- energy_cost = consumption*6.5
- elif consumption <300:
- energy_cost = consumption*7.2
- elif consumption <500:
- energy_cost = consumption*7.8
- else:
- energy_cost = consumption*9.0
- return energy_cost+fixed_cost
- #12 ############### LT-VII(A) ####################
- #A Two part tariff is for industrial cosumers#
- #commercial billing, connected load above 1000W #
- def calcLT_VIE(consumption, connected_Load, con_type):
- # fixed cost calculation for LT-VII(A)
- if con_type == 1:
- fixed_cost = connected_Load*60
- elif con_type == 3:
- fixed_cost = connected_Load*120
- else :
- print("Type of connection does not exists")
- # Energy cost calculation for LT-VII(A)
- if consumption < 100:
- energy_cost = consumption*6.0
- elif consumption <200:
- energy_cost = consumption*6.7
- elif consumption <300:
- energy_cost = consumption*7.4
- elif consumption <500:
- energy_cost = consumption*8.0
- else:
- energy_cost = consumption*9.3
- return energy_cost+fixed_cost
- #13 ############### LT-VII(A) ####################
- #A Two part tariff is for industrial cosumers#
- #commercial billing, connected load below 1000W #
- def calcLT_VIE(consumption, connected_Load, con_type)
- # fixed cost calculation for LT-VII(A)
- fixed_cost = connected_Load*40
- # Energy cost calculation for LT-VII(A)
- if consumption < 100:
- energy_cost = consumption*4.7
- elif consumption >300:
- print "You are having wrong tariff"
- energy_cost = 0
- elif consumption >200:
- energy_cost = consumption*5.7
- else:
- energy_cost = consumption*6.3
- return energy_cost+fixed_cost
- #14 ############### LT-VI(C) ####################
- #A Two part tariff is for industrial cosumers#
- #Cinema Theaters (single or three phase)#
- def calcLT_VIC(consumption, connected_Load):
- # fixed cost calculation for LT-VI(C)
- fixed_cost = connected_Load*90
- # Energy cost calculation for LT-VI(C)
- if consumption < 1000:
- energy_cost = consumption*5.90
- else:
- energy_cost = consumption*7.3
- return energy_cost+fixed_cost
- #15 ############### LT-IX ####################
- #A Two part tariff is for industrial cosumers#
- #Cinema Theaters (single or three phase)#
- def calcLT_VIC(consumption):
- # fixed cost calculation for LT-IX
- fixed_cost = 500
- # Energy cost calculation for LT-IX
- energy_cost = consumption*12.5
- return energy_cost+fixed_cost
Add Comment
Please, Sign In to add comment