Question: in python please Write a function called same_pattern that returns true or false depending on whether two strings have the same pattern of characters. More

in python please

in python please Write a function called same_pattern that returns true or

Write a function called same_pattern that returns true or false depending on whether two strings have the same pattern of characters. More precisely, two strings have the same pattern if they are of the same length and if two characters in the first string are equal, if and only if the characters in the corresponding positions in the second string are also equal. Below are some examples of patterns that are the same and patterns that differ (keep in mind that the method should return the same value no matter what order the two strings are passed). Ist String 2nd String Same Pattern? True True "ab" False "ab" "ab " True "aa " "xy"l False "aba" True - 1 "aba" False "abcabc' "zodzod" True "abcabd" "zodzoe" True "abcabc' "xXxxxx" False "aaasssccon" "aaabbbcccd" True "asasasasas" "xyxyxyxyxy" True "ascneencsa" "aeiouuoiea" True "aaasssccon" "aaabbbcccd" True "asasasasas" "xxxxxyyyyy" False "ascreencsa" "aeiouaeiou" False "aaasssccon" "xxxyyyzzzz" False "aaasssiiii" "gggdddfffh" False Your function should take two parameters: the two strings to compare. You are allowed to create new strings, but otherwise you are not allowed to construct extra data structures to solve this problem (no list, set, dictionary, etc). You are limited to the string functions on the cheat sheet

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 Programming Questions!