很难转换为整齐的列和行。有人可以帮忙吗?
我一直在尝试将列和行设置为0并从那里开始工作,但我无法弄明白。 我只是不知道在哪里插入信息。
n = 5
rate = 0.05
对于范围(0,3)中的n:
principal = 10000
for n in range (0,6):
principal <= 15000
simple = principal * (1 + rate * n)
compound = principal * (1 + rate)**n
ratea = rate * 100
ratea = int(ratea)
principal = int(principal)
print((ratea),"% $",principal," $","{:.2f}".format(simple)," $","{:.2f}".format(compound))
principal = principal + 1000
rate = rate + 0.05
答案 0 :(得分:1)
使用string
方法format
。