id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

growth2


Write a function growth2(totalDays) that simulates a population that grows by 3 individuals each day but also shrinks by, on average, one individual every 2 days. Return the final population after that number of days. You must use a for loop to complete this computation. Don't just plug the input into a mathematical formula.


growth2(10) → 25.0
growth2(1) → 2.5
growth2(2) → 5.0

...Save, Compile, Run (ctrl-enter)

def growth2(totalDays):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy