假如每天进步0.1%,那么365天会进步多少呢?
如果每天退步0.1/%,那么365天会后退多少呢?
问题求解:
dayup=pow(1.001,365)
daydown=pow(0.999,365)
print("进步{0},退步{1}".format(dayup,daydown))
假如每天进步0.1%或者0.5%,那么365天后会进步多少呢?
假如每天退步0.1%或者0.5%,那么365天后会变成多少呢?
dayfactor = eval(input("请输入每天进步或者退步的数值:"))
dayup = pow(1+dayfactor,365)
daydown = pow(1-dayfactor,365)
print("{0:.2f},{1:.2f}".format(dayup,daydown))
一年365天,一周5个工作日,每天进步1%,一周两个休息日,每天退步1%,那么一年后会变成怎样呢?
dayfactor=eval(input("请输入对应的数值:"))
for i in (1,365):
if i%7 in [6,0]:
dayup=dayup*(1-dayfactor)
else:
dayup=dayup*(1+dayfactor)
print("{0:.2f}".format(dayup))
-工作日需要进步多少,才能达到每天进步1%的效果呢?
-A君,一年365天,每天进步1%,不停息
B君,一年365天,工作日进步1%,周末休息退步1%,要多努力呢?
def dayup(df):
dayup=1;
for i in range (365):
if i % 7 in [6,0]:
dayup = dayup*(dayup-0.01)
else:
dayup = dayup*(dayup+df)
return dayup
dayfactor=0.01
while dayup(dayfactor)<37.78:
dayfactor += 0.01
print("工作日努力的参数是:{0:.4f}".format(dayfactor))
坚持,加油!!!