Write a python program to calculate electricity bill based on the following information- (CO2)
Unit Rate of charge
0-150 Rs. 3 per unit
151-350 Rs. 100 plus 4 per unit
Answers
Answered by
0
Program:
units = int(input("Enter units : "))
if units >= 0 and units <= 150:
Amount = units * 3
print("Electricity bill = ", Amount)
elif units >= 151 and units <= 350:
Amount = 100 + (150 * 3) + ((units - 150) * 4)
print("Electricity bill = ", Amount)
else:
print("Invalid input")
Output 1:
Enter units : 100
Electricity bill = 300
Output 2:
Enter units : 200
Electricity bill = 750
Output 3:
Enter units : 400
Invalid input
Similar questions