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

 

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

Vampires can each convert v people a day into vampires. However, there is a band of vampire hunters that can kill k vampires per day. If a coven of vampires starts with vampires members, how long before a town with a population of people becomes a town with no humans left in it? Write a function vampireApocalypse(v, k, vampires, people) that returns the answer to this question.


vampireApocalypse(2, 0, 1, 100) → 5
vampireApocalypse(2, 0, 1, 7000000000) → 21
vampireApocalypse(3, 2, 5, 100) → 3

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

def vampireApocalypse(v, k, vampires, people):

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