首页 > 编程语言 > 详细

python03-if

时间:2017-11-12 11:54:42      阅读:260      评论:0      收藏:0      [点我收藏+]

用if来实现猜年龄

 

age_of_master=66

guess_age=input(">>:")

if  age_of_master==int(guess_age):

  print("yes,you are right")  #print钱tab缩进

else:

  print("no,you must kidding me ")

 

多分支if语句:

 

score=input("you score:")

if score>90:

  print("you got an A")

elif score>80:

  print("you got an B")

elif score>60:

  print("you got an C")

else score<60:

  print("you should try harder!")

python03-if

原文:http://www.cnblogs.com/minkillmax/p/7821202.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!