n = int(input())sum = 0for i in range (1,n+1,1): sum = sum + 1/iprint (sum)
3
1.8333333333333333
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!