Question: Python 3.6 Question 13 Write a function named wordPositions) with the following input and output. Input: s, a string consisting of upper and lower case
Python 3.6

Question 13 Write a function named wordPositions) with the following input and output. Input: s, a string consisting of upper and lower case letters and spaces. Return: a dictionary in which each distinct word in s is a key and the corresponding value is a list of the positions in s in which the word occurs. Words are to be treated as the same regardless of their capitalization. That is, "Yes" and "yes" are the same word. The following is an example of correct output. >s 'One fish two fish red fish blue fish' Wp >>>print (wp) 'two [2 one' [01. 'red [4], fish': [1, 3. 5, 71. 'blue [61)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
