Python中的not in运算符是什么?

Python中的not in运算符是什么?

在Python中,in和not in运算符被称作成员运算符。它们的作用是检查一个对象是否是某个序列对象(如字符串、列表或元组)的成员。如果对象在序列中存在,则not in运算符返回false,如果未找到则返回true。

>>> 'p' not in 'Tutorialspoint'
False
>>> 'c' not in 'Tutorialspoint'
True
>>> 10 not in range(0,5)

更多Python相关文章,请阅读:Python 教程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程