Cognitive architectures such a Python ACT-R have been used to model human problemsolving strategies and behaviours in complex domains such as programming. However, to date, models of programming have not investigated various strategies for generating programs. To address this, the present thesis describes the construction of five cognitive models that represented different novice and expert strategies for solving a programming problem in Python. To aid in the design of the models, I conducted a talk-aloud study with expert and novice programmers. The models use a set of goals and steps that were identified in the study transcripts and solutions produced by the programmers in the study. Expert and competent novices were best modelled by the model utilizing an SGOMS framework. The SGOMS framework incorporated the ability to formalize the relationships between goals of the problem and allowed the model to structure the solution in the same way as experts and competent novices.