首页 > IT职业 > IT图书 > 在python中in是什么

in在python中是成员运算符,如果在指定的序列中找到值返回 True,否则返回 False。
例如
x 在 y 序列中 , 如果 x 在 y 序列中返回 True。
与in相反的是not in,如果在指定的序列中没有找到值返回 True,否则返回 False。
x 不在 y 序列中 , 如果 x 不在 y 序列中返回 True。
推荐学习《python教程》。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2572/viewspace-2834882/ ,如需转载,请注明出处,否则将追究法律责任。