p0 = int(input("Enter the starting population: "))
percent = float(input("Enter the percent: "))
aug = int(input("Enter the no.of inhabitants coming each year: "))
p = int(input("Enter the population to surpass: "))
percent = percent/100
years = 0
while p0 <= p:
p0 = p0 + percent*p0 + aug
years += 1
print(years)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Python