Write a function, called update_dictionary that has two parameters: a filename a
ID: 3718298 • Letter: W
Question
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 ty:why', "18:late', '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: late' because one of the rows in the txt file contains '18' and 'late'.Explanation / Answer
**Comment for any further queries.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.