Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

What are the basic codes of electricity bill using python program?

–3 votes
asked Feb 6, 2020 by carl

2 Answers

–1 vote
answered Feb 9, 2020 by anonymous
rate = float("Enter electricity rate :")

old_reading = float("Enter old reading :")

new_reading = float("Enter new reading :")

x = new_reading - old_reading

cost = rate*x

print("Your electricity bill is :",cost)
0 votes
answered Feb 10, 2020 by KOMMANABOYINA VENKATA NIKHL
fc=25
units=int(input("enter the no of units:"))
if (units>0 and units<100):
    pay=(units*1.5)+fc
    print('amount has to pay=',(pay))
elif(units>100 and units<200):
    pay=(units*1.5)+(units-100)*2.5+fc+25
    print('amount has to pay=',(pay))
elif(units>200 and units<300):
    pay=(units*1.5)+(units-100)*2.5+(units-200)*2.5+fc+50
    print('amount has to pay=',(pay))
elif(units>300 and units<400):
    pay=(units*1.5)+(units-100)*2.5+(units-200)*4+(units-300)*5+fc+75
    print('amount has to pay=',(pay))
elif(units>=500):
    pay=1500+fc+100
    print(pay)
else:
    pay=100+fc
    print(pay)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...