• 注册
    • 回帖总排行
    • 采纳总排行
    • 财富排行榜
    • 等级排行榜
  • learner
    We are the best gift for each other
    3002511金币
    关注
  • admintest
    We are the best gift for each other
    25金币
    关注
  • 讓歷史重演
    We are the best gift for each other
    2金币
    关注
  • 冰冷
    We are the best gift for each other
    2金币
    关注
  • 扬子江
    We are the best gift for each other
    2金币
    关注
  • 空白格‭
    We are the best gift for each other
    2金币
    关注
  • 相似的清风
    We are the best gift for each other
    2金币
    关注
  • 神经蛙
    We are the best gift for each other
    2金币
    关注
  • 高谈
    We are the best gift for each other
    2金币
    关注
  • 低调
    We are the best gift for each other
    2金币
    关注
  • learner
    We are the best gift for each other
    老铁/ 443 经验
    关注
  • admintest
    We are the best gift for each other
    小兵/ 7 经验
    关注
  • 讓歷史重演
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 冰冷
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 扬子江
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 空白格‭
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 相似的清风
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 神经蛙
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 高谈
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 低调
    We are the best gift for each other
    小兵/ 0 经验
    关注
  • 关注: 内容:

    Py001

  • 查看作者
  • 打赏作者
  • 拉黑名单
    • Py001

      短路逻辑:Py会把直接能影响结果的值抛出来

      -3%2 答案?当然是1啦

      再来点难得

      3 and 4 = ? 3

      3 or   4 = ? 4

      0 and 3 =? 0

      0 or   3 = ? 3    猜一下是为什么呢?

      讲解:0本身代表假(false) 

      OR只要有一边是真的 那么即为True 

      首先看3 or 4 从左向右看 3本身就是True 所以和右边没什么关系了,右边即使是false 那么答案也是True 3

      再来看0 and 3 从左向右看,and的运算方式是两边结果都是真,结果才是真,那么0本身代表是false所以,即使右边结果是 True 对于整体结果也毫无意义,所以Py直接抛出了 0

      001)最后出个简单小题目: False or 0 or 4 or 5 or True or 9 = ?   答案回复本帖即可看到!

      再接着来一题?

      not 1 or 0 and 1 or 3  and 4 or 5 and 6 or 7 and 8 and 9 = ?

      答案是4,是不是很多小伙伴算的是3呢?哈哈哈哈,你是不是脑子里面冒出来一连串的问号?

      好了我来告诉你们吧,对于数学运算符是分优先级的!

        Py001

      你需要登录,才能进行发帖操作
    • 单栏布局 帖子间隔 侧栏位置: