I am trying to use a parameter of a function to call a word inside a dictionary.
Here is my code
wordList = {
   'Apple' : ["A delicious snack"],
   'Word' : ["This code is not working..."],
}
def define(word):
   print wordList['Word']


When I use define('Apple') it returns ['This code is not working...'].
I tried defining word with a raw_input, but that didn't work, and I wouldn't know how to have them define another word.

<<attachment: kb1pkl.vcf>>

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to