📄 boolean_operators.py
字号:
var1 = 10
#-------------------------------------------------------------------------------
# The "and" Operator will only return True if both comparisons return True.
#-------------------------------------------------------------------------------
print var1 == 10 and var1 <= 5
#-------------------------------------------------------------------------------
# The "or" Operator will return True if any of the comparisons returns True.
#-------------------------------------------------------------------------------
print var1 == 20 or var1 >= 5
#-------------------------------------------------------------------------------
# The "not" Operator simply negates or inverts the result of the comparison.
#-------------------------------------------------------------------------------
print not var1 == 10
raw_input( "\nPress Enter to exit..." )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -