units = int(input("Enter the total number of units: "))
if units <= 100:
bill = 0
elif units <= 200:
bill = (units - 100) * 2
elif units <= 500:
bill = (100 * 2) + (units - 200) * 5
else:
bill = (100 * 2) + (300 * 5) + (units - 500) * 8
print(" Electricity Bill Amount: {bill})
output:
Enter the total number of units: 5000
Electricity Bill Amount: ₹37700
Top comments (1)
Using Python for EB bill basics allows users to efficiently calculate and manage electricity consumption. By leveraging simple logic and formulas, one can determine the total cost based on units consumed, tariff rates, and applicable taxes. Just like checking an electricity bill online, Python can automate bill calculations, making the process faster and more accurate. Whether for personal tracking or business use, Python provides a reliable way to handle energy expenses.