May 2019
Beginner to intermediate
452 pages
16h 34m
English
The get_questions function in this recipe saves a sorted list of filenames in the paths variable. It then filters the listing to only include the question images by checking whether the question.bmp string appears in the filename. This filtered list is then returned by the function.
The main function calls the get_questions function and saves its results to the questions variable. Each question is looped through and has its response image calculated when we replace the question.bmp value with response.bmp in the filename. Both the question and response filenames are then printed before the next iteration of the loop commences.
Read now
Unlock full access