gaohan 发表于 2018-8-15 12:51:28

python练习-if-else-条件匹配

age=float(raw_input("enter your age:"))  
grade=int(raw_input("enter your grade:"))
  
color=raw_input("enter your favorite color:")
  
if age >=8 and grade >=3 and color=="green":
  
    print "you can play this game."
  
else:
  
    print "sorry ,you can't play the game."
  

  
#只有age >=8,grade>=3,color==green才能玩游戏
页: [1]
查看完整版本: python练习-if-else-条件匹配