python怎么輸出數(shù)據(jù)集的指標(biāo)名?
mapper = dict(zip( ('Tom', 'Joes', 'Ki', 'Tim'), ('Teenage', 'Mutant', 'Ninja', 'Turtles') )
) def getName(): while True: name = raw_input("Enter a name: "
) if name in mapper: return name print "got:%s" % mapper.get(getName()) 用Python里的Dictionary