Electricity Bill Calculator

Problem: Write a program to calculate the electricity bill based on the following rates:

First 100 units: ₹5 per unit
Next 100 units: ₹7 per unit
Above 200 units: ₹10 per unit
250
Total : 1 Discussion
Login
ANTONY
    
ur test is wrong , please Look at my code
unit = int(input())

if(unit<=100):
  price = unit * 5
  print(price)
elif(unit>100 and unit<=200):
  res1 = 100 * 5 + (unit-100) * 7
  print(res1)
else:
  res2 = 100 * 5 + 100 * 7 + (unit-200) * 10
  print(res2)
  
Reply