I have made a code to check if a word chain is correct or not.The first input is the amount of words that will followingThe first and last letter of every word should be the sameTherefore a chain can look like this:  Alaska - baobab - Cadillac - drievuldigheid -  Enigma -  fotografencollectief - GasthuisbergIf the chain is incorrect the output should be the wrong word, else it should be 'word chain is correct'.As you'll be thinking, this is an excercise for school. I have exam in a few days and I'm doing some excercises.My code looks like this:import stringwords = int(input())alphabet = string.ascii_lowercaseoutput = ''for i in range(words):    woord = input()    #for the first word    if i == 0:        #make that the alpabet last letter is the starting letter of the word        alphabet = alphabet[alphabet.index(woord[0].lower())+1:] + alphabet[0:alphabet.index(woord[0].lower())+1]    #check if the last letter of the word is equal to the first  letter    #check if the last letter of the word is equal to the last letter of the alphabet    if woord[0].lower() == woord[-1].lower() and alphabet[-1] == woord[0].lower():        #if so: move the alphabet one Index        alphabet = alphabet[1:] + alphabet[:1]    elif output == '':        output = woordif output == '':    print('word chain is correct')else:    print(output)I'm wondering if there is some room for improvement, as it looks my code isn't pythonic at all.
Checking if a word chain is correct
python;beginner