码迷,mamicode.com
首页 > 其他好文 > 详细

Exercise 29: What If

时间:2014-10-24 18:01:42      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   sp   div   on   log   bs   

people = 20
cats = 30
dogs = 15
if people < cats:
  print "Too many cats! The world is doomed!"
if people > cats:
  print "Not many cats! The world is saved!"
if people < dogs:
  print "The world is drooled on!"
if people > dogs:
  print "The world is dry!"
dogs += 5
if people >= dogs:
  print "People are greater than or equal to dogs."
if people <= dogs:
  print "People are less than or equal to dogs."
if people == dogs:
  print "People are dogs."

 

Exercise 29: What If

标签:style   blog   color   ar   sp   div   on   log   bs   

原文地址:http://www.cnblogs.com/hluo/p/4048507.html

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