using python Write a function, called update dictionary that has two parameters:
ID: 3717395 • Letter: U
Question
using python
Write a function, called update dictionary that has two parameters: a filename and a dictionary. The function should: 1. Open the given file 1. If the file open succeeds print "filename loaded successfully." 2. If the file open fails: print "filename does not exist." 2. Read in the data and fill the dictionary. 3. Provide the new size: print "The dictionary has_entries." 4. Return the updated dictionary. tywhy, 18late, 'r:are, 'u':you) The dictionary key is the text abbreviation and the value is the English translation For example,one entry in your dictionary will be,18: ate' because one of the rows in the txt file contains 18' and late Test your function before moving on to the next question Answer: (penalty regime: 0 %) 1 def update_dictionary(filename, d):Explanation / Answer
Please find my code.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.