Question
need help on following python practice quesitions 1.Make a function find(str, char) that takes a string and a character (respectively) as arguments and returns the
need help on following python practice quesitions
1.Make a function find(str, char) that takes a string and a character (respectively) as arguments and returns the index of the first occurrence of that character.
2.Make a function multi_find(str, char) that takes a string and a character (respectively) as arguments and returns a list of all the indices where that character occurs.
3.Make a fuction my_reverse(list) that takes a list argument and returns a new list of all the items in list in reverse order. Do not use the Python built in reverse() function.
4.Make a function wordsList(sentence) that takes a string as an argument. This string consists of a paragraph. We want to makes lists of all the words in the paragraph that are the same length. We will make a dictionary that has lengths as the keys and lists as the values. Each word in the paragraph should be put into a list within a dictionary of words with the same length. That is, 2-letter words are put into one list, 3-letter words are put into another list, etc... (You may assume no words have more than 10 letters.). When complete, the function should return a dictionary containing all the lists that were created.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started