题解 | #取号#

取号

http://www.nowcoder.com/practice/2a61684ea405441eb9e572705defebdc

NP35 取号

思路:

step1:对应输入输出即可;注意条件的判断;

代码如下:

while True:
    try:
        print( "Welcome! How many people, please?\nEnter 'quit' to end the program.")
        n = input()
        if n == 'quit':
            break
        else:
            n = int(n)
            if n <= 4:
                print('Your small table is reserved!')
            elif 4 < n <= 6:
                print('Your middle table is reserved!')
            elif 6 < n <= 10:
                print('Your large table is reserved!')
            elif n > 10:
                print('Sorry, there is no free table that seats over ten persons.')
    except:
        break
全部评论

相关推荐

嵐jlu:我是山川🐔里🐔🧱的,阿里系简历全过; 你这简历一看就还是半成品啊,没有荣誉经历奖项什么的吗?
投递阿里巴巴集团等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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