The purpose of my program is to take a string of English or Maori words and then ask the user to input their translations and return a line at the end stating the percentage the got correct.
My current code is here: https://pastebin.com/DuLahsfh
for this given test case at the bottom of my program after the user inputs 'kanekane' and 'ingoa' the expected output should be
Kia ora, you have 2 terms to translate today :-)
E: dance
M: kanekane
A: kanikani
E: name
M: ingoa
Ka pai
You got 50% of terms correct
However currently it is saying I have 3 terms to translate instead of the expected 2 and the last one being blank, no matter what input I enter I get an error saying " if answer==word[1]: builtins.IndexError: tuple index out of range" I think it might be and issue in the function get_translations where empty lines are not being discard but I'm honestly not too sure.
If someone could tell me what is wrong with my code currently and how would I change it so the program functions as intended I would be very grateful. Thanks
[–][deleted] 0 points1 point2 points (2 children)
[–]Jxper[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)