Simple Question:
When I do 1/2 in python shell it gives float value
>>> 1/2
>>> 0.5
But
sum = 0
for i in range(1, 20):
    p = 1/i
    print(p)
    val = 2.0**p
    sum += val
    print(sum)
When run this program, value of p always comes to 0.
What is the reason behind this behaviour. What am i missing?
 
     
    