ITPub博客

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

在python中in是什么

IT图书 作者:glovey 时间:2021-09-11 10:23:51 0 删除 编辑

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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-16

  • 博文量
    86
  • 访问量
    770