The program I'm making is a program that will display a word in one language and ask for the translation in another. It will then display if it's right or wrong. However, when I test to see if it works, it will display all of the versions of Incorrect, even if the answer is correct. How do I get it to only display the appropriate message? Such as if somethings correct say ('Correct!') and if somethings wrong say ('Incorrect. The correct answer is _')
This is what I have:
words = ['ano', 'ima', 'eego', 'hai', 'gakusei', '...go', 'kookoo', 'gogo', 'gozen', '...sai', '...san', '...ji', '...jin', 'senkoo', 'sensei', 'soo desu', 'daigaku', 'denwa', 'tomodachi', 'namae', 'nan/nani', 'nihon', '...nensei', 'han', 'bangoo', 'ryuugakusei', 'watashi', 'amerika', 'igirisu', 'oosutoraria', 'kankoku', 'suweeden', 'chuugoku', 'kagaku', 'ajia kenkyuu', 'keizai', 'kokusaikankei', 'konpyuutaa', 'jinruigaku', 'seeji', 'bijinesu', 'bungaku', 'rekishi', 'shigoto', 'isha', 'kaishain', 'kookoosei', 'shufu', 'daigakuinsei', 'bengoshi', 'okaasan', 'otoosan', 'oneesan', 'oniisan', 'imooto', 'otooto']
random.shuffle(words)
index = 0
while index < len(words):
print(words[index])
translation = input('Enter the translation: ')
index += 1
print()
if words == 'ano' and translation == 'um':
print('Correct!')
else:
print('Incorrect.')
print('The correct answer is: um.')
if words == 'ima' and translation == 'now':
print('Correct!')
else:
print('Incorrect.')
print('The correct answer is: now.')
if words == 'eego' and translation == 'english':
print('Correct!')
else:
print('Incorrect.')
print('The correct answer is: english.')
(etc..this pattern continues until all words are used)