题解 | #取号#

取号

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

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

相关推荐

“校招”、“3-5年经验”
xiaolihuamao:逆向工程不是搞外挂的吗,好像现在大学生坐牢最多的就是诈骗罪和非法侵入计算机系统罪,发美金,还居家办公,就是怕被一锅端,
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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