DEV Community

yaswanth krishna
yaswanth krishna

Posted on

python using Eb bill basic

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})  

Enter fullscreen mode Exit fullscreen mode

output:
Enter the total number of units: 5000
Electricity Bill Amount: ₹37700

Top comments (2)

Collapse
 
brodericks11010 profile image
Broderickson Steven

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.

Collapse
 
studying_with_92b40098089 profile image
Studying With • Edited

The Picasso App is a stylish and convenient alternative for accessing a wide variety of entertainment, including live sports streams, TV channels, and movies. With its vast content library and user-friendly interface, Picasso makes it easy to enjoy pikashow the latest releases and live events for free. Whether you’re a sports enthusiast or a movie lover, Picasso has something for everyone, making it the perfect entertainment companion on the go.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.