Computer Science, asked by pari25325, 20 days ago

5. Write a python program to for Electric Bill charges according to charges. Following are the fines :
• First 100 Units: 1 Rs per day.
• Next200 Units: 2 Rs per day.
• Above300 Units: 4 Rs per day.

Answers

Answered by CreativeAB
5

Your Solution:

#program for calculating electricity bill in Python

units=int(input("please enter the number of units you consumed in a month"))

if(units<=100):

payAmount=units*1.5

fixedcharge=25.00

elif(units<=200):

payAmount=(100*1.5)+(units-100)*2.5

fixedcharge=50.00

elif(units<=300):

payAmount=(100*1.5)+(200-100)*2.5+(units-200)*4

fixedcharge=75.00

elif(units<=350):

payAmount=(100*1.5)+(200-100)*2.5+(300-200)*4+(units-300)*5

fixedcharge=100.00

else:

payAmount=0

fixedcharge=1500.00

Total=payAmount+fixedcharge;

print("\nElecticity bill=%.2f" %Total)

I hope you got it. You can refer the image.

Keep Learning & Keep Growing

Happy Studying :)

Attachments:
Similar questions