# coding=utf-8 // 支持中文 voted = {} def check_voter(name): if voted.get(name): print "剔除" else: voted[name] = True print "可以投票" check_voter("tom") check_voter("jack") check_voter("tom")