The most important task for a beginning computer science student, in order for them to succeed in their future studies, is to learn to be able to understand code. One of the greatest indicators of student success in beginning programming courses is the ability to read code and predict its output, as this shows that the student truly understands what each line of code is doing. Yet few tools available to students today focus on helping students to improve their ability to read code. The goal of the random Python program generator is to give students a tool to practice this important skill.
The program writes randomly generated, syntactically correct Python 3 code in order to provide students infinite examples from which to study. The end goal of the project is to create an interactive tool where beginning programming students can click a button to generate a random code snippet, check if what they predict the output to be is correct, and get an explanation of the code line by line. The tool currently lacks a front end, but it currently is able to write Python code that includes assignment statements, delete statements, if statements, and print statements. It supports boolean, float, integer, and string variable types.