Re: [Tutor] Calling a dictionary entry inside of a function

2009-09-18 Thread Alan Gauld
Corey Richardson wrote: 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'] You put quotess around word whic

Re: [Tutor] Calling a dictionary entry inside of a function

2009-09-18 Thread Benno Lang
On Sat, Sep 19, 2009 at 9:27 AM, Corey Richardson wrote: > 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 wordLi

[Tutor] Calling a dictionary entry inside of a function

2009-09-18 Thread Corey Richardson
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 w