def while return float

1
2
3
4
5
6
7
def m(n):
a = 0
i = 1
while i <= n:
a = a + i
i = i + 1
return a/float (n)