a = {'tom':'湯姆','mike':'麥克','peter':'彼德'} name = input('輸入姓名(tom, mike,pteer)') if name in a: print(name,'在姓名dict裡面') else: print(name,'不在姓名dict裡面')