Start by implementing the get_flash_cards function. This function has one parameter, filename, which will be the name of the file containing the questions/answers. (This file should use the format we just described.) This function will return a dictionary where a key will be the question and the associated value will be the answer. For example, given the example file above, you would return a dictionary with the following contents: {'cow': 'vaca', 'cat': 'gato', 'food': 'comida', 'apple': 'manzana', 'smile': 'sonrisa'} Part of the function has already been completed for you in comp110_lab11.py, you just need to finish it. After you finish, test this function in the REPL, using both the spanish-small.txt and baseball.txt files as test files Language Python
Start by implementing the get_flash_cards function. This function has one parameter, filename, which will be the name of the file containing the questions/answers. (This file should use the format we just described.) This function will return a dictionary where a key will be the question and the associated value will be the answer.
For example, given the example file above, you would return a dictionary with the following contents:
{'cow': 'vaca', 'cat': 'gato', 'food': 'comida', 'apple': 'manzana',
'smile': 'sonrisa'}
Part of the function has already been completed for you in comp110_lab11.py, you just need to finish it.
After you finish, test this function in the REPL, using both the spanish-small.txt and baseball.txt files as test files
Language Python
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images