程序:
import turtle
def main():
money_every_week=10
zhou=1
increase_money=10
total_week=52
saving=0
while zhou<=total_week:
saving+=money_every_week#存钱
print('第{}周,存入{}元,账户累计{}元'.format(zhou,money_every_week,saving))
#更新下一周存钱金额
money_every_week+=increase_money
zhou+=1
if __name__=='__main__':
main()
运行结果: