Checking for letter matches
I have a sample string "this string gets stuck". I am trying write a loop that will compare the last last letter of a word with the first letter of the next word to see if the match. So, with this four word string I would check the last letter of "this" ("s") and see if it matches the fist letter off "string" ("s"). I know how to check this for the first and second word with string[0][-1] for the last letter, first word and string[1][0] for the first letter, second word. I am trying to figure out how to loop through each word pairs in the string to check for the same. My thought is to maybe have the first loop = string[0][-1]==string[1][0] and then have the loop advance to each successive pair of words by string[0+1][-1] and string[1+1][0] adding one to each word in the string to compare the first and last letters throughout, but I am not sure how to phrase this. I know that I could probably use regex for matches, but I am not exactly sure how I loop through with that method.