学习目标:
例如:
- 一周6.14起完成基础pytho知识学习
- 只要学习一定要写一篇CSDN
学习内容:
1.学习try语句
2.学习分支语句
学习时间:
2022.6.17 10:00---------2022.6.17 12:00
2022.6.17 13:10-----------2022.6.17 16:05
学习产出:
1.知道了try 语句,当try语句运行没问题时。那么会跳过try语句执行后面的代码,try语句的作用就是为了减少elif 的存在。因为如果你用elif 那么你需要想到每一种情况,那是不可能的。
2.知道了For (变量) in 的用法,变量会循环遍历每一个字符并返回,暂时不知道这个有什么用。
3.知道了continuous 和break 的区别,continue 是在for i in range 下停止在continue前的循环,而后会继续重复循环,而break则是完全停止,不会再继续循环了。
4.自己设计了四个数取最大的决策树算法
下面展示一些 自己设计的决策树算法
。
x1=input('please fill the space with different number:')
x2=input('please fill the space with different number:')
x3=input('please fill the space with different number:')
x4=input('please fill the space with different number:')
if int(x1) > int(x2):
if int(x4) > int(x3):
if int(x1) > int(x4):
print("the correct number is:",int(x1))
else:
print("the correct number is:",int(x4))
else:
if int(x2)>int(x3):
print("the correct number is:",int(x1))
else:
if int(x4) >int(x3):
if int(x4) >int(x2):
print("the correct number is:",int(x4))
else:
print("the correct number is:",int(x2))
else:
if int(x3) > int(x2):
print("the correct number is:",int(x3))