Well it is mainly because of integer division. But if you use Python 3.x, you will get your desired output. Python 3.x, automatically takes both numerator and denominator as float, when you are perform divisions but Python 2.x takes it as you've defined earlier.
Find out more interesting facts about Python in this Python tutorial series.
You can also go ahead and start coding by referring to this well structured video.