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

 

david.white@denison.edu cs111fall2019 > growth4
prev  |  next  |  chance

Write a function growth4(totalDays) that simulates a population that grows by 2 on the first day, 4 on the second day, 8 on the third day, 16 on the fourth day, etc. Assume that the initial population size is 10. Return the total population size on the last day. Use a for loop.


growth4(10) → 2056
growth4(1) → 12
growth4(2) → 16

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

def growth4(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