title: error:'builtin_function_or_method' object is not iterable
body: <p>In some other tutorial the following  python code for finding words from a json file which worked for them. but, not for me.
  would you please help me to get rid of this error.</p>
  
  <pre><code>import json
  from difflib import get_close_matches
  
  data = json.load(open("data.json"))
  
  def translate(word):
      word = word.lower
      if word in data:
          return data[word]
      elif len(get_close_matches(word, data.keys())) &gt; 0:
          yn=input ("did you mean %s instead? Enter Y if yes and N if no" % get_close_matches(word, data.keys())[0])
          if yn == "Y":
              return data[get_close_matches(word, data.keys())[0]]
          elif yn == "N":
              return("the word doesn't exist")
          else:
              print("we don't understand your entry")
      else:
          return("the word does't exist please crosscheck it")
  
  word = input("enter a word: ")
  
  output = translate(word)
  
  if type(output) == list:
      for item in output:
          print(item)
  else:
      print(output)
  </code></pre>
  
  <p>This is the error I got:</p>
  
  <pre><code>Traceback (most recent call last):
    File "pracjson.py", line 23, in &lt;module&gt;
  
      output = translate(word)
    File "pracjson.py", line 10, in translate
      elif len(get_close_matches(word, data.keys())) &gt; 0:
    File "C:\Users\Vishnu's World\AppData\Local\Programs\Python\Python37\lib\difflib.py", line 723, in get_close_matches
      s.set_seq2(word)
    File "C:\Users\Vishnu's World\AppData\Local\Programs\Python\Python37\lib\difflib.py", line 279, in set_seq2
      self.__chain_b()
    File "C:\Users\Vishnu's World\AppData\Local\Programs\Python\Python37\lib\difflib.py", line 311, in __chain_b
      for i, elt in enumerate(b):
  TypeError: 'builtin_function_or_method' object is not iterable
  </code></pre>