Question: Write a FUNCTION named FindStrings, that will take a list ( list of strings ) as a parameter. The function should return a list indices

Write a FUNCTION named FindStrings, that will take a list (list of strings) as a parameter. The function should return a list indices (indexes). The indices returned represent the strings at the index of the list that contain the special character below. If no strings in the list contain the special character or the function is passed an empty list, then the function should return an empty list.
Special Character: 'R' or 'r'(uppercase and lowercase special Characters should be detected) NOTE: The resulting list should be sorted from lowest index to highest index.
Examples:
code example 1
x=['programming','is', 'really', 'fun']
print(FindStrings( x ))
output if 'code example 1' is executed
[0,2]
Because 'programming' at index 0 of the input list contains the special character.
'really' at index 2 of the input list contains the special character
code example 2
x=['p12og12amming', 'is','12eally', 'fun']
print(FindStrings( x ))
output if 'code example 2' is executed
[]
code example 3
x=['p12og12amming', 'is','12eally', 'fRun']
print(FindStrings( x ))
output if 'code example 3' is executed
[3]
code example 4
x=[]
print(FindStrings( x ))
output if 'code example 3' is executed
[]

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!