Python-programming-exercises icon indicating copy to clipboard operation
Python-programming-exercises copied to clipboard

Question 65 error

Open chaihub opened this issue 5 years ago • 2 comments

Question 65 defines f(0) = 1. However, the expected answer for f(5) = 500 is wrong (should be 501). Also, the code assumes f(0) = 0. So either the question should be changed, or the expected answer and the code should be changed.

chaihub avatar Nov 10 '20 10:11 chaihub

Please provide a link to that particular question.

hDmtP avatar Nov 15 '20 14:11 hDmtP

yeah the code should be **def f(n): if n==0: return 1 else: return f(n-1)+100

n=int(input()) print(f(n))**

according to the question we have to return 1 for f(0)

Question 65 defines f(0) = 1. However, the expected answer for f(5) = 500 is wrong (should be 501). Also, the code assumes f(0) = 0. So either the question should be changed, or the expected answer and the code should be changed.

amansoni000 avatar Jul 22 '21 06:07 amansoni000