python-天天向上的力量
程序员文章站
2022-05-18 07:55:25
...
python-天天向上的力量
range跟()
[6,0]
#DayDayUp
dayup = pow(1.001, 365)
daydown = pow(0.999, 365)
print("向上:{:.2f},向下{:.2f}".format(dayup, daydown))
dayfactoror = 0.005
dayup1 = pow(1+dayfactoror, 365)
daydown1 = pow(1-dayfactoror, 365)
print("向上:{:.2f},向下:{:.2f}".format(dayup1,daydown1))
dayup2 = 1.0
dayfactoror2 = 0.01
for i in range(365):
if i % 7 in [6,0]:
dayup2 = dayup2*(1 - dayfactoror2)
else:
dayup2 = dayup2*(1 +dayfactoror2)
print("工作日的力量:{:.2f}".format(dayup2))
def dayUP(df):
dayup3 = 1
for i in range(365):
if i % 7 in [6,0]:
dayup3 = dayup3*(1 - 0.01)
else:
dayup3 = dayup3*(1 + df)
return dayup3
dayfactor3 = 0.01
while dayUP(dayfactor3) < 37.38:
dayfactor3 += 0.001
print("工作日的努力参数是:{:.3f}".format(dayfactor3))
上一篇: 【Python】天天向上的力量
下一篇: Python-天天向上的力量