Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Having trouble incorporating a loop to my python code i have to ask the user Do you want to calculate another population? example: while
Having trouble incorporating a loop to my python code i have to ask the user Do you want to calculate another population?" example:
while uservalue q:
Here are the rules:
You must use a loop to repeat the births and deaths for each generation. Do not def statements, main, break, or lower
Your program should allow the user to repeat the calculations as many times as they wish as above Use a while loop for this. That part is kind of similar to the Bidding example below
import random
random.seed
keepbidding y
nextbid
# continues to bid until the user enters n
while keepbidding n:
nextbid nextbid random.randint
printfIll bid $nextbid
printContinue bidding? yn end
keepbidding input
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started