Question: Write the code for a Python function called load Dictionary that accepts a dictionary, a list, and a letter (with a default value of
Write the code for a Python function called load Dictionary that accepts a dictionary, a list, and a letter (with a default value of 'X') and stores the list in the dictionary using the letter as the key before returning the entire dictionary. The function prototype MUST be: def loadDictionary(book, sequence, key = "'X') : For example, given the following variables: letter = 'Q' myDict = {} seq1 = [31, 32, 33, 34, 35, 36, 37, 38, 39] then the function call and print: newDict = loadDictionary(myDict, seq1, letter) print(newDict) would display: {'Q': [31, 32, 33, 34, 35, 36, 37, 38, 39]}
Step by Step Solution
There are 3 Steps involved in it
def loadDictionarybook sequence let... View full answer
Get step-by-step solutions from verified subject matter experts
