Question: please use python to solve this Now, instead of indexing a list, you can write a function that finds at which index/indices a character is

please use python to solve this please use python to solve this Now, instead of indexing a list,

Now, instead of indexing a list, you can write a function that finds at which index/indices a character is found within a string Write a function that uses a for loop and the range function to return a list of all indices at which a char occurred in the text. For example, if the input text is Mississippi and charis , the function should return 12, 3, 5, 6); if the char is the function should return [0]; if the charis 1, you should get 11, 4, 7, 101. def get index_list(text, char): Given text and a single character char, which are both strings, return a list that contains the indices at which char occurred in the text. If text or char is not a string, or if a char is longer than 1 character, return None. If char is not found, return an empty list return "stub

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!