1 s=input("请输入年利率:")
2 rate=float(s[:-1])*0.01
3 money=100000
4 year=0
5 while money<=200000:
6 money=round( ),2)
7 year=year+1
8 print(year,"年后收益超过本金。”)
微信扫码预览、分享更方便