Python Exercises-Conditional Statements
Python Exercises-Conditional Statements
21. Input three values a, b, and c and sort these three values in ascending order by comparing and
exchanging their values. At the end of the program a <= b <= c must hold. You can solve this exercise
with three if in minimum. Test your program with all six permutations of three different numbers.
The Electricity Board charges from their consumers according to the units consumed per month. The amount to
be paid as per the given tariff:
Units consumed Charges
Up to 100 units Rs.5.50/unit
For next 200 units Rs.6.50/unit
For next 300 units Rs.7.50/unit
More than 600 units Rs.8.50/unit
Write a program to input consumer’s name, consumer number and the units consumed. The program displays
the following information at the time of receiving the money receipt as:
Money Receipt
Consumer Number :
Consumer’s Name :
Units consumed :
Amount to be paid :