Question: Add another function, random_item, that takes a list as a parameter and returns a random word from the list. This function should work for any
Add another function, random_item, that takes a list as a parameter and returns a random word from the list. This function should work for any length list. Make sure that all items in the list can be selected and it never generates runtime errors. It is recommended that you modify main to call it on several short example lists such as[5] and ['x', 4]. After testing, modify main to use the function with the list of words obtained from read_words. Have main print out the random word selected.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
