deeplearning-cv-notes icon indicating copy to clipboard operation
deeplearning-cv-notes copied to clipboard

Python基础补充

Open jayboxyz opened this issue 5 years ago • 1 comments

学习参考:

Python 入门

jayboxyz avatar Nov 09 '19 03:11 jayboxyz

print 输出内容到文件


year = 1
years = 5
bj = 10000
rate = 0.05
f = open("./source/interest.bak", 'w+')
while year < years:
    bj = bj * (1 + rate)
    print("第{0}年,本金息总计{1}".format(year, bj), file=f)

jayboxyz avatar Nov 09 '19 03:11 jayboxyz