I have to create a game in python, where I have to code a game called 'word chain' where the last letter of a word has to be the same as the first letter of another word.
The user should input 2 words and it should say if the words are valid or not. If they are valid the code should play the game again.
I am quite new to programming.
I have tried to code the game, but whenever the words are valid it says so but when they're not it still says they're valid and the loop plays again even when it should stop.
a = True
while a:
one = input('Word 1: ')
two = input('Word 2: ')
if two[-1] != one[0]:
print('Valid') #print result
else:
print('Nope! The other player won.') #print result
a = False
break