题解 | #游乐园的门票#

游乐园的门票

http://www.nowcoder.com/practice/29cc8d49d7bf4197a1cdbfcee340f846

while 1:
    print("Please tell me your height!\nEnter 'quit' to end the program.")
    try:
        str = input()
        if str == 'quit':
            break
        else:
            num = float(str)
            if num < 0 or num > 3:
                print('数字不合法')
                continue
            if num < 1.0:
                print('Your admission cost is 0 yuan.')
            elif num >= 1.0 and num<=1.2:
                print('Your admission cost is 80 yuan.')
            else:
                print('Your admission cost is 150 yuan.')
    except TypeError:
        continue
全部评论

相关推荐

野猪不是猪🐗:😇:恭喜你以出色的表现成为xxx的一员 😨:您以进入本公司人才库 实际点开:您愿望单中的xxx正在特卖!
点赞 评论 收藏
分享
迷茫的大四🐶:那你问他上班之后老实了没
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务