doraemon的python之旅 整型、布尔值和字符串1

时间:2019-06-24 09:09:36   收藏:0   阅读:66

运算补充

1.in  和 not in #判断某个东西是否在里面

content = input"请输入内容:"

if "sex" in content:

  print("包含敏感字符")

while True:

  content = input"请输入内容:"

  if "sex" in content:

    print("包含敏感字符")

  else:

  print(content)

  break

2.优先级

not 2>1

解读: not 2       >1    #错误

      not     2>1       #正确     not and or  是所有运算符号里最低级的

原文:https://www.cnblogs.com/doraemon548542/p/11067145.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!