Python Lesson
For this function I need three different variables (starts1,starts2,length). Starts1 and starts2 are the list of locations the prefix and suffix were respectively found. Length is the total length of the prefix of, example, “atg” which could be “at”. The function I need to create must create a list of combinations with a space between the two different substrings, or prefixes and suffixes. This represents the possible misspelling.
I begin in my function by identifying my list as ‘finalmatches’, and m as equal to length. Then I proceed to process the starts1 and starts2 lists through two “for” loops. These two loop sets will compare all the different possible combinations of substrings with the addition of one space. It will then add all of these combinations to the list “finalmatches” and return that last back into the code for use after that function is called.