美文网首页
2018-07-07-python-逻辑操作符-and-判断输入

2018-07-07-python-逻辑操作符-and-判断输入

作者: mychineseheart | 来源:发表于2018-07-07 20:09 被阅读0次

1.代码明细:

#逻辑运算符 and

#

x = int(input("请输入数据:"))

if 0<=x<=100:

    print("输入的数据合法")

if x >=0 and x<=100:

    print("输入的数据合法")

2.操作明细.

tarena@tedu:~/桌面$ python3 and.py

请输入数据:20

输入的数据合法

输入的数据合法

tarena@tedu:~/桌面$ python3 and.py

请输入数据:30

输入的数据合法

输入的数据合法

3.代码说明.

代码还不够完善,只是为了说明 逻辑运算符 and 的用法,日后有能力需要不间断完善.

4.others

tarena,zhuhairui2018.7.7 19:50xinfang901.

相关文章

网友评论

      本文标题:2018-07-07-python-逻辑操作符-and-判断输入

      本文链接:https://www.haomeiwen.com/subject/mxokcftx.html