Python解决问题

img

题目:2.若设某国网民已有4.8亿,年以6.1%的速度增长,求多少年后,该国网民将达到或超过8亿。 变量建议:多少年为year,增长率为rate,网民数为s。

输出结果:9年后网民将有8.26380753218276亿,达到或超过8亿

我这个写的哪里有错误


year=0
s=4.8
rate=0.061

while s<8:
    year+=1
    s*=(1+rate)
    
print(s,year)