Question: 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 user_value !='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(5)
keep_bidding ='y'
next_bid =0
# continues to bid until the user enters 'n'.
while keep_bidding !='n':
next_bid = next_bid + random.randint(1,10)
print(f'I\'ll bid ${next_bid}!')
print('Continue bidding? (y/n)', end='')
keep_bidding = input()
 Having trouble incorporating a loop to my python code i have

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!