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

3-条件语句练习

时间:2019-12-30 17:31:56      阅读:48      评论:0      收藏:0      [点我收藏+]

标签:color   语句   pre   put   inpu   int   ==   col   练习   

age=int(input("请输入你家小狗的姓名"))
if age<0:
    print("别闹,腰不好")
elif age==1:
    print("相当于十四岁的人")
elif age==2:
    print("相当于22岁的人")
elif age>2:
    human=22+(age-2)*5
    print("对应的年龄是",human)

3-条件语句练习

标签:color   语句   pre   put   inpu   int   ==   col   练习   

原文地址:https://www.cnblogs.com/waox/p/12120481.html

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