当前位置:网站首页>3.2daydayup draw inferences from one instance: three days of fishing and two days of net learning
3.2daydayup draw inferences from one instance: three days of fishing and two days of net learning
2022-07-23 12:34:00 【King who personally patrols the mountain】
# daydayupQ5.py
# Three days of fishing and two days of net learning
# def Reserved words are used to define functions , Return one this time dayup value
def dayUP(df):
dayup = 1
for i in range(365):
if i % 3 in [1,2]: # 120120120....
dayup = dayup * (1 - 0.01)
else:
dayup = dayup * (1 + df) # Here is the custom variable
return dayup # Strictly indent , And for Statements are parallel structures Give the return value
dayfactor = 0.01
#dd = 1
A = pow(1+dayfactor, 365)
#while dayUP(df) < A: # Execute the above for loop ,NameError: name 'df' is not defined
#while dayUP(dd) < A: # Hard work during the working day is worth :0.010
while dayUP(dayfactor) < A:
dayfactor += 0.001
print(" Hard work during the working day is worth :{:.3f}".format(dayfactor))
边栏推荐
- 单片机学习笔记6--中断系统(基于百问网STM32F103系列教程)
- Baidu Shen Shuo: focus on the scene, deeply cultivate the industry, and bring practical results to enterprise Digitalization
- [introduction to AUTOSAR com 4.com service layer module]
- How to establish data analysis thinking
- Practical convolution correlation trick
- Enter the triangle side length and calculate the area
- 求矩阵的鞍点及其对应的下标。
- 嵌入式从入门到精通(入土)——超详细知识点分享3
- 嵌入式从入门到精通(入土)——超详细知识点分享1
- 使用PyOD来进行异常值检测
猜你喜欢
随机推荐
高分子合成工艺学复习考题
鋼結構基本原理複習
高电压技术学习总结
高等代数知识结构
Interpretation of the paper: develop a prediction model based on multi-layer deep learning to identify DNA N4 methylcytosine modification
1、经济学十大原理
A comprehensive and detailed summary of the basic principles of steel structure
钢结构复习题
时间序列的数据分析(二):数据趋势的计算
【基于UDS服务的BootLoader架构和刷写流程】
博客搭建五:图床选择
Object class
LVGL8.1版本笔记
Eigen multi version library installation
单片机学习笔记1--资料下载、环境搭建(基于百问网STM32F103系列教程)
Using or tools to solve path planning problem (VRP)
钢结构基本原理题库
【AUTOSAR COM 3.信号的收发流程TX/RX】
[introduction to AUTOSAR com 4.com service layer module]
Question bank of basic principles of steel structure






![[AUTOSAR cantp 1. learn the network layer protocol of UDS diagnosis]](/img/dc/51a4f091c623dbaaa4c174ebdae92a.png)


