Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions