Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem C. (iv points) searching ior a string This problem will exercise your ability with looping constructs over multiple strings. The goal of this function

image text in transcribed
image text in transcribed
Problem C. (iv points) searching ior a string This problem will exercise your ability with looping constructs over multiple strings. The goal of this function is given three strings A, B, and C. Find all of the characters that are in both strings A and B, but not in String C. Write one function called character_search(string_a, string_b, string_c) The function will take in three parameters string_a, string_b, and string_c all of which will be string objects. The function will build and return a string containing all of the characters that are in string_a and string_b, but which are not in string_c. The output string should have the letters in the same order they appear in string__. Hints: - You may assume that no character appears in a single string multiple times. Constraints: - You are not allowed to use the Python set intersection, the in keyword to check for inclusion, or anything similar, to trivialize the problem. This should be done only with strings and loops. - The in keyword when used as required by for loop syntax is acceptable You are welcome to add an if _ name _ = _ main _ block and test cases for this and all functions in this assignment but this is not required. Examples (text in bold is returned): character_search ("ABCDEFGHI", "ABCD", "abCd") Hints: - You may assume that no character appears in a single string multiple times. Constraints: - You are.not allowed to use the Python set intersection, the in keyword to check for inclusion, or anything similar, to trivialize the problem. This should be done only with strings and loops. - The in keyword when used as required by for loop syntax is acceptable You are welcome to add an if __ name _ = _ main _ block and test cases for this and all functions in this assignment but this is not required. Examples (text in bold is returned): character_search("ABCDEFGHI", "ABCD", "abCd") 'ABD' character_search("cats dog", "cats", "a") 'cts' character_search("cats dog", "rats", "a") 'ts' character_search("cats dog", "cats ", "cats ")

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions