编辑代码

# coding:utf-8
#JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
voted = {}
def check_voter(name):
    if voted.get(name):
        print("投票失败!")
    else:
        voted[name] = True
        print("投票成功!")

check_voter("tom")
check_voter("milk")
check_voter("milk")