商科本科硕士转码的预习自习第三课

学习目标:

例如:

  • 一周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))
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值