美文网首页
2018-12-01 天天向上

2018-12-01 天天向上

作者: 子小亦大 | 来源:发表于2018-12-01 10:16 被阅读0次

    天天向上

    #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)))

    相关文章

      网友评论

          本文标题:2018-12-01 天天向上

          本文链接:https://www.haomeiwen.com/subject/zvylcqtx.html