zoukankan      html  css  js  c++  java
  • python符号的优先

    运算符描述
    lambda Lambda表达式
    or 布尔“或”
    and 布尔“与”
    not x 布尔“非”
    in,not in 成员测试
    is,is not 同一性测试
    <,<=,>,>=,!=,== 比较
    | 按位或
    ^ 按位异或
    & 按位与
    <<,>> 移位
    +,- 加法与减法
    *,/,% 乘法、除法与取余
    +x,-x 正负号
    ~x 按位翻转
    ** 指数
    x.attribute 属性参考
    x[index] 下标
    x[index:index] 寻址段
    f(arguments...) 函数调用
    (experession,...) 绑定或元组显示
    [expression,...] 列表显示
    {key:datum,...} 字典显示
    'expression,...' 字符串转换

    优先级是最小面最优先、从下往上数、如果迩还不信、迩可以运行一下下面的小代码来证实

    true = True
    false = False
    if not false or true:
    print "yes"
    else:
    print "no"


    ##
    #ture or false => true
    #false or false => false
    #ture or ture => true

    ##如果是先not后or、那么一定会返回true、也就是yes
    ##如果是先or后not、那么一定会返回false、也就是no、
    ##但结果输出了yes、证明是先not后or



  • 相关阅读:
    Bootstrap 插件收集
    target和currentTarget
    微信小程序
    flex
    vue中使用icon和打包
    rem的使用
    vue中使用sass和compass
    vue父子组件传递参数
    weex
    常用软件&&网址
  • 原文地址:https://www.cnblogs.com/klobohyz/p/2318421.html
Copyright © 2011-2022 走看看