Question: Python Coding Problem 4.30 LAB: Magic String The code template below takes an input two strings the first my_string in a string literal of unknown
4.30 LAB: Magic String The code template below takes an input two strings the first my_string in a string literal of unknown length and the second magic, sa three character string Complete the program to assign the variable my result with one of four possible values . 3 nagic in a substring of my_string 2 any two character substring of magic is also a substring of my string but magte toelf is not If any of the characters in magic appears in my string, but no two character substrings not magte are substrings of my_string . O, if no characters in magic appear at all in ny_string For example, suppoon my_stringin The main architect was Slartibartfast. Then if magic is 'art, my result in 3 since art' is a substring of my_string magic is 'arx' my result is because an is a two character substring of ny_stringil magic is my_result is because 'm in a one character substring of my_string. If magic na xfz,my_result in O), of course, You may tissue magic always has only three unique characters that need not be letters). You should assume care sensitivity, that is for example, a and Aare not the same letter Some hints 1 The expression eagle in my string returna True if the string literal labeled with the name magic is a nating of the string oral Labeled with the name wystrine 2 magical return the oth (that is, the first character in magic magic[1] returns the lot (that in the second character in magic, and 3. magic(012) returnt a string built from the oth and Tat characters of magic magic 1: contains the 1st and 2nd only so on LAB ACTIVITY 430. LAB Magic String 0/ main.py Load default template 1 ytring - Input) magic - Input 4 your code oes here 5 print result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
