加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

在Python中使用<>. <>是操作符吗?

发布时间:2020-12-20 12:23:29 所属栏目:Python 来源:网络整理
导读:参见英文答案 What does `` mean in Python?????????????????????????????????????5个 11False 12True 13True 10True 11False 有什么用?在Python? 有人可以帮助解释上述或’‘一般来说. 解决方法 它是不等式运算符,与!=同义.从 documentation: The forms
参见英文答案 > What does `<>` mean in Python?????????????????????????????????????5个

>>> 1<>1
False
>>> 1<>2
True
>>> 1<>3
True
>>> 1<>0
True
>>> 1<>1
False

<>有什么用?在Python?
有人可以帮助解释上述或’<>‘一般来说.

解决方法

它是不等式运算符,与!=同义.从 documentation:

The forms <> and != are equivalent; for consistency with C,!= is preferred; where != is mentioned below <> is also accepted. The <> spelling is considered obsolescent.

<>拼写已在Python 3中删除.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读