小Y的Python学习日志--流程控制(逻辑符)

#本文仅为个人学习过程的整理和记录,如有从他人博客、网站摘录的内容,本人会明确标明,如有涉及侵权,请联系本人,本人会在第一时间删除。

   以下的资料整理来自(1)廖雪峰的Python教程 http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000

            (2)简明Python教程 http://woodpecker.org.cn/abyteofpython_cn/chinese/

 

(1)逻辑运算符 and

  x=int(input('Please Input x : '))
  y=int(input('Please Input y : '))
  if x>=60 and y>=60:
   print('Good')
  else:
   print('Bad')

(2)逻辑运算符 or

  x=int(input('Please Input x : '))
  y=int(input('Please Input y : '))
  if x>=80 or y>=80:
   print('Good')
  else:
   print('Bad')

(3)逻辑运算符 not

  def fun():
   return 0
  x=int(input('Please Input x : '))
  y=int(input('Please Input y : '))
  if not fun():
   print('ok')
posted @ 2015-03-07 22:44  AFLinY  阅读(123)  评论(0)    收藏  举报