当我输入他的名字时,我想看到约翰的号码。首先要这样做:
def liste_kontrol(liste):
liste=raw_input("Name pls:")
if liste=="john":
print "now u seeng on list",john,"number."
else:
print "cant found"
liste={"john":002050505",}
liste_kontrol(liste)
也许下一个:
def liste_kontrol(liste):
liste=raw_input("Name pls:")
if liste=="john" or "jack:
print "now u seeng on list", john, or jack, "number."
else:
print "cant found."
liste= {"john":"002050505","jack":"0551282"}
liste_kontrol(liste)