- Describe the significance of the global variable index. How is indexing used with lists in this app?
- The variable “index” is used to house the index of all three lists at the same time (parallel lists). Index 1 in the questions list correlates to index 1 in the answers and pictures lists. This links all of the lists together.
- Describe how parallel lists were used in this app. Why was the parallel structure of the lists necessary?
- all three lists were tied together in that they were all sorted in the same order for each question/answer/picture set. The lists had to be in the same order so that one index could be used to retrieve the correct information from each quiz question. The quiz would not work if the lists were not coordinated in this fashion.
- Include screenshots of your code for exercises 2 and 3 from the Enhancements section.
- joining the correct answer if they user was incorrect:
- Random selection of a quiz question:
- Include a screenshot of the code that added your extra question (exercise 4). Explain why the code for the buttons worked without any changes after the addition of the extra question.
- I only had to add the fourth entry in each list. This worked because I am using the variable “index” instead of hard-coding the index number in anywhere other than restarting at 1.