Answer:
Step-by-step explanation:
The following is written in Python and the code first creates a simulated keypad with all the characters. Then the function detects the number passed as an input argument and outputs all the possible spelling combinations.
keypad = {
'2': 'abc',
'3': 'def',
'4': 'ghi',
'5': 'jkl',
'6': 'mno',
'7': 'pqrs',
'8': 'tuv',
'9': 'wxyz',
}
def word_numbers(number):
number = str(number)
wordList = ['']
for char in number:
letters = keypad.get(char, '')
wordList = [prefix+letter for prefix in wordList for letter in letters]
return wordList