Question: Hey I need help with this question I don't understand Why my code prints out None after the correct code prints out below I have
Hey I need help with this question I don't understand Why my code prints out None after the correct code prints out below I have added the question mycode and the output any help with fixing this problem is appreciated



10 t of On some basic cell phones, text messages can be sent using the numeric keypad. Because each key has multiple letters associated with it, multiple key presses are needed for most letters. Pressing the number once generates the first character listed for that key. Pressing the number 2, 3, 4 or 5 times generates the second, third, fourth or fifth character. Key Symbols 11 ..?!: 2 ABC 3 DEF 4 GHI 15 JKL 6 MNO 17 PQRS 8 TUV 9 WXYZ JO 'space Write a function called convert_message_to_keys (message) which takes a message as a parameter and converts the message to the key presses needed to generate the message. You should construct a dictionary that maps from each letter or symbol to the key presses needed to generate it. Then use the dictionary to create and display the presses needed for the user's message. Note: Ensure that your program handles both uppercase and lowercase letters. Ignore any characters that aren't listed in the table above such as semicolons and parentheses. For example: Test Result print(convert_message_to_keys('hello')) 4433555555666 print(convert_message_to_keys('Python is fun')) 7999844666660444777703338866 '} S = 7 1 v def convert_message_to_keys(message): 2 d = {1: ['.', '?', '!', ':'], 2: ['A', 'B', 'C'], 3: ['D', 'E', 'F'], 3 4: ['G', 'H', 'I'], 5: ['J', 'K', 'L'],6: ['M', 'N', '0'], 4 7: I'P', 'Q', 'R', 'S'], 8: ['T', 'U', 'V'], 9: ['w', 'X', 'y', 'Z'], 0: 5 message 6 string s.upper(); 7 s_ind 0 8 j = 0 9 while (j = 0): 18 print(k, end="") 19 s_ind = s_ind 1; 20 print(" ") if (j 7 17, 21 Precheck Check Precheck only Test Expected Got print(convert_message_to_keys ('hello')) 4433555555666 4433555555666 X None
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
