Question: In Python Write a function called madLib that takes in a string and a dictionary. The input dictionary will have keys that are integers and

In Python
Write a function called madLib that takes in a string and a dictionary. The input dictionary will have keys that are integers and data values that are strings Your function should replace the word in the original string at each key value with the data for that key value. Your function should return an updated string. Ex: inputString-I like chocolate milk" InputDictionary 10:"we", 3:"cookies" Should return the string "we like chocolate cookies" You may find the split() and str() functions for strings and lists to be useful
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
