This is my 3rd day of #100daysofcode. I learned alots of thing about python basis with the help of Goggle, youtube and Coursera.
Today I learned specially about looping, List, file handling, function etc. I also did some course of coursera in the topic python data structure. Here is a code of mine which I used to calculate the amount of money purchasing for electric bill. In this code I used multiple if else statements for multiple conditions. There are different amount according to units consumed criteria.
# python program to calculate electric bill units = int(input('Please enter the number of unit you consumed: ')) if(units < 50): amount = units * 2.60 surcharge = 25 elif(units <= 100): amount = 130 + ((units - 50)*3.25) surcharge = 35 elif(units <= 200): amount = 130 + 162.50 + ((units - 100)* 5.26) surcharge = 45 else: amount = 130 + 162.50 + 526 + ((units - 200)*8.45) surcharge = 75 total = amount + surcharge print('\n Electricity Bill = %.2f' % total)