Word2sms Grok intro to python 2 code not working (grok learning)

30 Views Asked by At

I was trying to do the grok challenge but my program was not working, also I could not find anything that looked wrong to me. This is my code so far:

# A dictionary containing the letter to digit phone keypad mappings.
**        KEYPAD = {
        'A': '2', 'B': '2', 'C': '2', 'D': '3', 'E': '3',
        'F': '3', 'G': '4', 'H': '4', 'I': '4', 'J': '5',
        'K': '5', 'L': '5', 'M': '6', 'N': '6', 'O': '6',
        'P': '7', 'Q': '7', 'R': '7', 'S': '7', 'T': '8',
        'U': '8', 'V': '8', 'W': '9', 'X': '9', 'Y': '9',
        'Z': '9',
    }
    word = input('Enter word: ')
    wordlist = word.split
    for i in wordlist:
      print(KEYPAD[i])**

I tried changing the variable in the for loop from 'word' to 'i' but nothing worked. It just came up with this error: **Traceback (most recent call last):

File "program.py", line 12, in <module>
   for a in wordlist:
TypeError: 'builtin_function_or_method' object is not iterable.**
0

There are 0 best solutions below