Question: Each time Kevin re-reads his Python book (which happens every month), he learns some percentage of whatever material he didn't know before. He has a

Each time Kevin re-reads his Python book (which happens every month), he learns some percentage of whatever material he didn't know before. He has a target score (example: 95%) on the final exam to get an A in the class. When Kevin starts, he knows nothing about Python.

For example: When Kevin knows 20% and his monthly learning rate is 10%, then after one month Kevin will know 20% + 10% * 80% = 28%. In the next month, he will know 28% + 10% * 72% = 35.2%.

Write a generic functiongetLearningTime(rate,target)that simulates this learning progress andreturnsthe number of months it will take to get ready for the exam. Therateis the learning rate (in the example above 20%), and thetargetis the score that is to be achieved (in the example above 95%).

Note:Assume 0% knowledge when you start learning.

Note:rateandtargetare < 1 (i.e. arateof 0.2 means a 20% learning rate)

Example function call:getLearningTime(0.1,0.9)

This is python, thank you!

start the code with def getLearningTime(rate, target):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!