题解 | #名单中出现过的人#
名单中出现过的人
https://www.nowcoder.com/practice/d70f0bbba1bb4683a8789e86c0978f01
name_tuple = ('Tom', 'Tony', 'Allen', 'Cydin', 'Lucy', 'Anna') name = input() print(name_tuple) k = 0 for i in name_tuple: if(i == name): print('Congratulations!') break else: if(k == len(name_tuple) - 1): print('What a pity!') k = k + 1