天天向上
#daydayup
def daydayup(df):
dayup = 1
for i in range(365):
if i%7 in [6,1]:
dayup = dayup * (1 - 0.01)
else:
dayup = dayup * (1 + df)
return dayup
if __name__ == "__main__":
a = pow(1.01,365)
dayfactor = 0.01
while daydayup(dayfactor) < a :
dayfactor += 0.001
print("the dayfactor is {:.3f}, and the dayup is {:.3f}.".format(dayfactor,daydayup(dayfactor)))
网友评论