Can someone help me with this code? I am using Python 3 and this is a beginner level course.
Statistics Canada projects population based on the following assumptions:
- One birth every 78 seconds
- One death every 105 seconds
- One new immigrant every 147 seconds
My assignment:
- Write a program to display the population for each of the next ten years (i.e. 1 to 10 years from now). Assume the current population is 38,233,484 and one year has 365 days.
- Now rewrite the program to prompt the user to enter the number of years and displays the population after that many years. Your program will not accept a negative number.
All I could figure out till now is this:
mylist= [1,2,3,4,5,6,7,8,9,10]
for x in mylist:
print("Year", x, "has a population of",r)
def population(b, d, i):
p=(b+i-d)
return p
a=(1/78)
b=(1/105)
c=(1/147)
r=population (a,b,c)
Anwser 1:
Answer 2: