Python之路,第二篇:Python入门与基础3

1,  布尔运算符

             运算符;    not      and   or

          not 运算符:

           作用:逻辑取反

           语法: not  表达式

           例: not  True     #  False

                   not   False   # True

1 score = int(input("请输入:"))
2 if not 0 <= score <= 100:
3     print("Error, 您输入的不对!")
4 >>> 
5 请输入:1000
6 Error, 您输入的不对!
7 >>> 

猜你喜欢

转载自www.cnblogs.com/weizitianming/p/8922177.html