思路:还是首先大概了解题意,2和14请我吃饭。
输入格式结束条件是遇到符号"." 所有我们可以采用while循环
然后输出部分分三种情况,这样我们就可以动手写代码了
num = [] #存放点赞名单
while True:
temp = input() #输入点赞名单
if temp == '.': #到符号.结束
break
else:
num.append(temp) #加入名单
if len(num)>=14: #情况一
print("%s and %s are inviting you to dinner..."%(num[1],num[13]))
elif len(num)>=2 : #情况二
print("%s is the only one for you..."%(num[1]))
else: #情况三
print("Momo... No one is for you ...")