Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions