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

Python 3.6 Question 13 Write a function named wordPositions) with the following

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!