Question: Write a method called letterPositions ( ) which takes in two strings and returns a tuple. The first string can be a phrase of any
Write a method called letterPositions which takes in two strings and returns a tuple. The first string can be a phrase of any length while the second one will always be a single character. The tuple that the method returns must contain the index of all occurrences of the second string inside the first string. Be sure to not discriminate between upper and lower case ie: a and A should be the same character If the resulting output is an empty tuple, simply return the empty tuple.
Outside the method, prompt the user for a phrase, a letter, and then print out the resulting tuple as per the sample outputs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
