Question: Write a function sum_reciprocals() which takes 1 input argument, a positive integer n, and returns 1 output value, the sum of the reciprocals of

Write a function "sum_reciprocals()" which takes 1 input argument, a positive integer "n", and returns 1 output value, the sum of the reciprocals of all integers from 1 to n (inclusive). The result should be returned as a floating point number, and rounded to 5 decimal places (use Python's "round()") function). For example: Test Result print (sum_reciprocals (2)) 1.5 print (sum_reciprocals (5)) 2.28333
Step by Step Solution
There are 3 Steps involved in it
Python program to create and test the function sumreciprocals that takes an integer n and retu... View full answer
Get step-by-step solutions from verified subject matter experts
