题解 | #取号#
取号
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