

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Exponents
incomplete
2: Exponent Quiz
incomplete
3: Exponents Grow
incomplete
4: Non-Linear Growth
incomplete
5: Logarithms
incomplete
6: Logarithm Quiz
incomplete
7: Factorials
incomplete
8: Factorial Quiz
incomplete
9: Exponential Decay
incomplete
10: Logarithmic Scale
incomplete
11: Mean and Median
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Exponents grow very large very quickly. Let's take a look at an example of them doing that, in code.
Click to play video
While the influencers who use our platform are really great at taking selfies, most aren't super great at math. We need to write a tool that predicts an influencer's follower growth over time.
Complete the get_follower_prediction function. It takes a follower_count integer, an influencer_type string and a num_months integer, and returns an integer.
Calculate the number of followers an influencer will have after a given number of months according to the influencer type:
"fitness": follower count quadruples each month"cosmetic": follower count triples each monthFor example, if a "fitness" influencer starts with 10 followers, then after 1 month they would have 40 followers. After 2 months, they would have 160 followers, and so on.
This kind of sequence, where each term is found by multiplying the previous term by a constant, is called a geometric sequence or geometric progression.
Use the following version of the geometric progression formula, in which a1 is the initial number of followers, r is the multiplication constant, and n is the number of months:
total = a1 × r^n