dayup = 1.0
dayfactor = eval(input('参数:'))
for i in range(360):
if i % 30 in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
dayup = dayup * (1 + dayfactor)
else:
dayup = dayup
print("{:.2f}".format(dayup))
参数:0.001
1.13
dayup = 1.0
dayfactor = eval(input('参数:'))
for i in range(360):
if i % 30 in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]:
dayup = dayup * (1 + dayfactor)
else:
dayup = dayup
print("{:.2f}".format(dayup))
参数:0.001
1.13
有没有一种可能结果就是1.13,我自己写的和你的代码结果都是1.13啊,答案是什么
N=0.001
dayup=1.0
for i in range(360):
if i%30 in range(1,11):
dayup=dayup*(1+N)
print("{:.2f}".format(dayup))