filmov
tv
Write a Program to Calculate Electricity Bill in Python

Показать описание
In this program, the user is prompted to enter their electricity usage in kilowatt-hours (kWh). The program then calculates the bill amount based on the user's usage, using the following tariff rates:
Up to 50 kWh: $0.50 per kWh
51-150 kWh: $0.75 per kWh
151-250 kWh: $1.20 per kWh
Above 250 kWh: $1.50 per kWh
The program then adds fixed charges of $30 and a 5% tax on the bill amount (excluding fixed charges) to calculate the total bill. Finally, the program prints the total bill amount rounded to two decimal places.
Up to 50 kWh: $0.50 per kWh
51-150 kWh: $0.75 per kWh
151-250 kWh: $1.20 per kWh
Above 250 kWh: $1.50 per kWh
The program then adds fixed charges of $30 and a 5% tax on the bill amount (excluding fixed charges) to calculate the total bill. Finally, the program prints the total bill amount rounded to two decimal places.