Python operator.not_()函数与示例
operator.not_()函数 (operator.not_() Function)
operator.not_() function is a library function of operator module, it is used to perform "NOT operation" on a given value and returns True if the given value is zero or any falsy value, False, otherwise.
operator.not_()函数是运营商模块的库函数,它被用于如果给定的值是零或任何falsy值, 假上的给定值并返回true执行“NOT操作”,否则。
Module:
模块:
import operator
Syntax:
句法:
operator.not_(x)
Parameter(s):
参数:
x – value on which NOT operation to be performed.
x-要对其执行NOT操作的值。
Return value:
返回值:
The return type of this method is bool, it returns True if x is zero or any falsy value, False, otherwise.
此方法的返回类型为布尔 ,如果x是零或任何falsy值, 假返回true,否则。
Example:
例:
# Python operator.not_() Function Example
import operator
print("operator.not_(True):", operator.not_(True))
print("operator.not_(False):", operator.not_(False))
print()
x = 1
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
x = 10
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
x = -10
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
x = 0
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
x = "Hello"
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
x = ""
print("x:", x)
print("operator.not_(x):", operator.not_(x))
print()
Output:
输出:
operator.not_(True): False
operator.not_(False): True
x: 1
operator.not_(x): False
x: 10
operator.not_(x): False
x: -10
operator.not_(x): False
x: 0
operator.not_(x): True
x: Hello
operator.not_(x): False
x:
operator.not_(x): True
翻译自: https://www.includehelp.com/python/operator-not_-function-with-examples.aspx
Python operator.not_()函数与示例相关推荐
- python中cos函数_Python代码中cos()函数有什么功能呢?
摘要: 下文讲述Python代码中cos()函数的简介说明,如下所示: cos()函数功能 用于计算出x 弧度-所对应的的余弦值 cos()函数语法 math.cos(x) ---------参数说明 ...
- pycharm zip函数_寒假整理3:Python的 zip函数 map函数 eval函数 的含义及应用实例
以下是我前年自学时找到的几个简单易懂的博客,但是没有记录来源,权作为整理者稍作删改排版,记录在下. 注:代码是Python2版本,不妨碍理解,基本上就是print少了括号. Python的zip函数 ...
- python中随机数函数_Python随机数函数
摘要: 下文讲述Python代码中seed()函数的简介说明,如下所示: seed()函数功能 用于改变随机数生成器的种子, 常用于其它随机函数之前运行此函数 seed()函数语法 seed.seed ...
- Python operator.le()函数与示例
operator.le()函数 (operator.le() Function) operator.le() function is a library function of operator mo ...
- Python operator.lt()函数与示例
operator.lt()函数 (operator.lt() Function) operator.lt() function is a library function of operator mo ...
- Python operator.truth()函数与示例
operator.truth()函数 (operator.truth() Function) operator.truth() function is a library function of op ...
- python operator __gt___Python operator.gt方法代码示例
本文整理汇总了Python中operator.gt方法的典型用法代码示例.如果您正苦于以下问题:Python operator.gt方法的具体用法?Python operator.gt怎么用?Pyth ...
- Python中的sorted函数以及operator.itemgetter函数
from:Python中的sorted函数以及operator.itemgetter函数 operator.itemgetter函数 operator模块提供的itemgetter函数用于获取对象的哪 ...
- python中operator.itemgetter函数
operator模块提供的itemgetter函数用于获取对象的哪些维的数据,参数为一些序号(即需要获取的数据在对象中的序号),下面看例子. k = [3,6,8]b = operator.itemg ...
最新文章
- 基于jQuery+ashx+.net实现三级栏目联动操作
- c ef框架-mysql_.net EF框架 MySql實現實例
- 采集音频和摄像头视频并实时H264编码及AAC编码[转]
- DDos攻击的一些领域知识——(流量模型针对稳定业务比较有效)不稳定业务采用流量成本的检测算法,攻击发生的时候网络中各个协议的占比发生了明显的变化...
- SAP CRM WebClient UI图标url的生成逻辑
- linux系统调试网络,linux系统命令(网络相关的调试命令)
- 利用赫夫曼编码进行数据解压
- kvm vnc的使用,鼠标漂移等
- http://www.zhihu.com/question/24896283
- linux下hg无法运行_linux下hg无法运行_Linux下Mercurial (hg)配置说明
- 使用 conda uninstall xxx时,一直卡在 Collecting package metadata (repodata.json)
- 内核抢占PREEMPT_RT
- 2018秋招心酸路---持续更新【面挂家】
- java 剪切 图片 BufferedImage
- 阿里实习生电话面试果断被鄙视
- 左旋肉碱溶液铁离子去除办法
- 为什么大学还在教过时的软件技术,程序员:只能说你根本不懂软件
- 京东云加速扩展“朋友圈” 火力全开大展生态“云”图
- 国产化之银河麒麟.netcore3.1访问https服务的两个问题
- 简析Acrel-1000安科瑞变电站综合自动化系统选型与应用
热门文章
- html中一张a4是多少pt,CSS设置A4纸张尺寸
- 一分钟学会python编程_用Python教你一分钟检验出来!不用群发_编程语言_Python课程_Python教程_课课家...
- c语言什么时候需要加分号,归纳一下html中什么时候需要分号什么时候需要冒
- epson彩色打印机加墨水_爱普生打印机墨盒如何加墨?
- mysql数据库参数
- HDFS常用Shell命令
- 用户账号管理基本概念
- MySQL与PHP连接
- 一点一点看JDK源码(五)java.util.ArrayList 后篇之removeIf与Predicate
- iBatis——执行原理