python实例---天天向上的力量
程序员文章站
2022-05-18 07:55:31
...
version 1
#daydayup.py
dayfactor=0.005
dayup=pow(1+dayfactor,365)
daydown=pow(1-dayfactor,365)
print(“向上:{:.2f},向上,向下:{:.2f}''.format(dayup,daydown))
version 2
#daydayupq3.py
dayup=1.0
dayfactor=0.01
for i in range(365):
if i %7 in [6,0]:
dayup*=(1-dayfactor)
else:
dayup*=(1+dayfactor)
print("工作日的力量:{:.2f}".format(dayup))
version 3
def dayup(df):
dayup=1
for i in range(365):
if i %7 in [6,0]:
dayup*=(1-0.01)
else:
dayup*=(1+df)
return dayup
dayfactor=0.01
while dayup(dayfactor)<37.78:
datfactor+=0.001
上一篇: 【SAP】ABAP——屏幕上的chain
下一篇: sap内存和abap内存的使用