码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2015-03-08 00:03:30      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

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

   以下的资料整理来自(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‘)

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

标签:

原文地址:http://www.cnblogs.com/liquidbean/p/4321066.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!