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

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

1 Expert Approved Answer
Step: 1 Unlock

def loadDictionarybook sequence let... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!