4. Electricity Bill Calculator

Acceptance 100% 1 accepted 1 submissions

Easy
No topics listed
No companies listed
Write a Python program that asks the user to enter the number of units of electricity consumed. Then calculate the total electricity bill based on the following slab rates: First 100 units are charged at 5 rupees per unit. Next 100 units (from 101 to 200) are charged at 7 rupees per unit. Any units beyond 200 are charged at 10 rupees per unit. Print the total bill amount as an integer. The program must take units as input from the user.

Example 1

Input
250
Output
1700

Explanation First 100 units at 5 = 500, Next 100 units at 7 = 700, Remaining 50 units at 10 = 500, Total = 1700

Example 2

Input
50
Output
250

Explanation 50 units are within first 100 units so 50 x 5 = 250

Example 3

Input
150
Output
850

Explanation First 100 units at 5 = 500, Next 50 units at 7 = 350, Total = 850

Acceptance 100%
Accepted 1
Submissions 1
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
1700
No results yet
Run your code to test it against the sample cases.
Problem List