3 Star 0 Fork 1

mirrors_trekhleb/learn-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_logical.py 737 Bytes
一键复制 编辑 原始数据 按行查看 历史
Oleksii Trekhleb 提交于 2018-08-29 23:23 +08:00 . Add Python scripts.
"""Logical operators
@see: https://www.w3schools.com/python/python_operators.asp
Logical operators are used to combine conditional statements.
"""
def test_logical_operators():
"""Logical operators"""
# Let's work with these number to illustrate logic operators.
first_number = 5
second_number = 10
# and
# Returns True if both statements are true.
assert first_number > 0 and second_number < 20
# or
# Returns True if one of the statements is true
assert first_number > 5 or second_number < 20
# not
# Reverse the result, returns False if the result is true.
# pylint: disable=unneeded-not
assert not first_number == second_number
assert first_number != second_number
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_trekhleb/learn-python.git
git@gitee.com:mirrors_trekhleb/learn-python.git
mirrors_trekhleb
learn-python
learn-python
master

搜索帮助