Abstract
Computational Thinking (CT) has evolved as an essential competency for K-12 students, and programming practices are recognized as the key way to facilitate CT development. However, most studies of CT development in middle graders have focused on visual programming, lacking evidence to demonstrate the effectiveness of Python programming. Therefore, this study first developed 16 Python programming courses based on the CodeCombat programming platform. Then we conducted a 16-week Python programming course intervention study with 79 middle school students in seventh, eighth, and ninth grades in China to clarify the impact of Python programming on middle graders’ CT. The results revealed that Python programming intervention significantly improved CT for seventh, eighth, and ninth graders. The analysis of interaction effects for grade and gender showed that Python programming was most beneficial for eighth graders in CT improvement. Meanwhile, we found that the difference in CT caused by the gender factor varied according to grade level. Specifically, the gender factor caused significant CT differences in eighth and ninth graders, and girls were better performers than boys. These findings enrich the outcomes of Python programming and CT education in middle schools and provide implications for frontline programming educators to conduct Python interventions.
In recent years, the accelerating development of digital technology has driven continuous digitization changes in various fields globally, and CT has reached the worldwide consensus as a methodology skill necessary for adapting to the 21st century’s smart era (Kong et al., 2018; Sigayret et al., 2022; Sun & Liu, 2024b). In 2006, Wing (2006) stated systematically that CT is essentially a set of thinking skills that use computer science knowledge to understand human behavior. Subsequently, Bundy (2007) also indicated that a deeply educational change in CT is quietly taking place. Nowadays, teaching students to master CT through programming has become a priority concern at the higher education level, the secondary education level, and even the primary education level across the world, and has led to a global wave of reforms in CT teaching and learning. Most countries in the European Union, as well as Japan and the United States, have made CT and programming education mandatory courses in secondary schools to develop students’ basic abilities for the future society (Bocconi et al., 2022). Some provinces and cities in China have even included CT and programming in the academic level examination, but the text programming curriculum for systematic cultivation of CT has not yet been formed.
As shown above, programming education practices have received extensive attention from researchers around the world for the most efficient way to develop CT. Overview of existing programming education studies for the middle school level, most of them use graphical programming methods based on building blocks to teach students CT (Lawanto et al., 2017; Zhang & Nouri, 2019). However, researchers have observed that graphical programming methods are not as effective as textual programming in motivating the cognitive development of middle school students (Sun & Liu, 2023). Practically, textual programming languages such as LOGO, C, and C++, which are based on advanced compilation environments, allow students to understand the logical relationships within programming and develop a deeper understanding of algorithms (Saygıner & Tüzün, 2022). However, the traditional method of teaching text programming focuses on teaching pure programming knowledge and programming commands. Abstract programming and CT content can overload the cognitive load of middle school students, and even make them reluctant and resistant to text programming. With the abundance of programming teaching methods, Python programming quickly became the first choice for novice programmers because of its concise syntax and ease of access. However, while some of the current research has demonstrated the effectiveness of Python programming in a particular grade of middle school (Bai et al., 2021; Kroustalli & Xinogalos, 2021), the differences in its adaptability and effectiveness in different grades have not been adequately answered. This leads to difficulties for teachers to compare the CT developmental needs of students in different grades horizontally during instruction, and the design of programming instructional activities lacks evidence of optimization.
Therefore, to bridge the research gap on the effectiveness of Python programming practices, this study designed 16 weeks of Python teaching activities based on the CodeCombat programming platform and explored its impact on Chinese middle school students’ CT. Moreover, we fully considered the differential effects of individual characteristics such as middle school students’ grade level and gender on the educational effects of Python programming and CT. In programming learning, students’ grade level usually positively characterizes their cognitive proficiency level, which may affect students’ adaptation and acceptance of Python programming. Meanwhile, the impact of gender stereotypes that exist in CT and programming has not been harmonized in the academic community yet (Jiang & Wong, 2021; Sun & Liu, 2023). Meanwhile, most of the existing research on Python programming practices has only explored the influence of a single gender and grade factor, and lacks an exploration of the synergistic relationship between the two influences. More importantly, Chinese junior high school students (12–14 years old) are in the critical period of the development of the formal arithmetic stage and the window of neuroplasticity (Fischer, 1980), and are susceptible to the socialization effects of gender stereotypes (She, 1998). However, few studies have been conducted to clarify the effects of the intersection of grade level and gender factors on junior high school students’ CT. Therefore, it is urgently needed to explore the critical impact of grade level and gender in the process of Python programming instructional activities to provide empirical evidence for personalized CT education.
Theoretical Foundations and Related Work
Computational Thinking
CT has been widely discussed by researchers as an essential competency for living in the age of digital intelligence, but there is still no academically accepted definition of CT. The first appearance of the term “computational thinking” was traced to the book Mindstorms: Children, computers, and powerful ideas (Papert, 1980). At this time, Papert (1980) described CT as a thinking skill acquired by children in the process of running a sequence of programming instructions using LOGO. Papert provided no precise definition of CT, perhaps due to the fact that computers and programming were not yet fully accessible at the time. In 2006, Wing (2006) defined CT as the capability of people to use abstraction, parallel processing, and other abilities in computer science to design and solve real-world complex problems. In 2008, Wing (2008) further extended CT and proposed that CT is not an exclusive skill of computer scientists, but rather a generic skill used by academics in various fields to solve problems. This range of perspectives has led to extensive exploration of the conceptual framework and definitional aspects of CT by educational organizations and academics worldwide. In 2011, the Computer Science Teachers Association (CSTA) and International Society for Technology in Education (ISTE) (2011) collected and summarized the perspectives of nearly 700 computer science educators, stating that CT is a core set of skills used in the problem-solving process. Meanwhile, Selby and Woollard (2013) pointed out that CT is a combination of cognitive or thinking processes that synthesize the use of abstraction, algorithmic thinking, deconstruction, and other skills to solve problems. Additionally, Shute et al. (2017) stated that CT includes skills such as deconstruction, abstraction, and debugging, and argued that CT exists not only in the process of applying computers to solve problems but also extends to all problem-solving contexts. In summary, we primarily refer to the definition of Shute et al. (2017), which considers CT as students’ use of skills such as abstraction, deconstruction, algorithmic thinking, debugging, and evaluation to solve Python programming problems.
Because of the diversity of CT skill definitions and the wide range of applicable domains, researchers have also attempted to develop various types of tools to accurately evaluate students’ CT skills (Del Olmo-Muñoz et al., 2020; Sun & Liu, 2023). Some researchers developed automated tools for assessing CT skills in Alice (Grover et al., 2017) and Scratch (Moreno-León et al., 2015) programming programs. Moreover, scales and test questions have attracted the attention of researchers as more convenient assessment methods. For example, Kukul and Karatas (2019) developed a self-efficacy scale for 319 middle school students, which includes four dimensions—reasoning, abstraction, deconstruction, and generalization—allowing for the assessment of students’ perceived mastery of CT skills. Kong et al. (2018) developed an assessment scale containing the four dimensions of programming meaningfulness, impact, self-efficacy, and creativity based on the perspective that programming empowers learning. Román-González (2015) developed the Computational Thinking Test (CTt) using standardized psychometric item development methods to assess the CT skills of Spanish middle school students. The validated CTt consisted of 28 items, each set as multiple-choice and involving various computer science concepts such as loops, branching structures, and functions. Meanwhile, Relkin et al. (2020) created the TechCheck test, which includes an array of unplugged programming activities, to measure the CT skills of students in kindergarten and lower primary school. In addition, there is the globally popular Bebras test. The Bebras test questions are based on real-life scenarios and effectively measure students’ ability to apply CT to solve real-world problems (Dagienė & Sentance, 2016). The Bebras test currently has more than 70 member countries worldwide, and many studies have confirmed that the Bebras test is effective in measuring students’ CT skills (Sun & Liu, 2023). Therefore, this study utilized the Bebras test as the instrument to assess participants’ CT skills.
Computational Thinking in Python Programming Education
The view that programming learning is a critical approach to facilitating students’ CT growth has been consistently confirmed by researchers (Lye & Koh, 2014; Wong & Cheung, 2018). Extensive studies have shown that both visual programming methods, such as Scratch (Jiang & Li, 2021) and Code.org (Sun & Liu, 2024a), which use drag-and-drop blocks, and unplugged methods, such as CS Unplugged (Rodriguez et al., 2017) and pen-and-paper programming (Deng et al., 2020), significantly enhance CT skills in K-12 students. However, some researchers have indicated that graphical and unplugged programming styles are not as productive as Python programming styles in terms of training in CT (Sun & Liu, 2023). One large-scale survey in the European Union reported that the education authorities in many countries stated that graphical programming instruction was possible to perform in the early years of basic education but gradually transitioned to Python and C++ programming in the upper years (Bocconi et al., 2022). Ultimately, visual programming primarily involves assembling blocks, while unplugged programming focuses on completing card or maze tasks without actual coding. Hence, these styles hardly stimulate students’ “native” understanding of CT and programming knowledge. In contrast, Python programming language involves students writing code to perform sequential operations, which supports students’ mastery of the basic syntax and underlying logic of the programming language and is also more conducive to students’ growth in CT. Python’s concise syntax, readability, and built-in standard functions significantly reduce programming complexity, making it accessible to K-12 students.
Python was originally developed to create an easy-to-read, easy-to-write programming language that enables everyone to become an expert programmer.
Python has received considerable attention from researchers in the programming and CT fields as the most suitable programming language for novice learners. Many studies investigated the impact of Python programming instructional interventions on students’ CT. For example, Hambrusch et al. (2009) reacted to the CT research movement by teaching programming concepts, data analysis, and simple machine learning algorithms through a semester-long Python programming program in a university course titled “Introduction to Computational Thinking”. At the end of the semester, the students’ CT skills and interest in CT were found significantly improved. Meanwhile, Allan et al. (2010) jointly developed four programming programs by combining Python programming with high school curriculum content by several high school teachers and computer science experts. The results found that the Python programming projects significantly contributed to the improvement of high school students’ CT and even increased their willingness to pursue computer science careers. From the above, Python programming not only effectively develops students’ CT, but also improves students’ attitudinal tendencies toward CT. However, most current studies of Python programming practices target high school and college students, and few researchers have explored the effects of Python programming on middle school students. Therefore, there is a necessity to implement a systematic Python programming curriculum practice at the middle school level to investigate its impact on middle school students’ CT.
Grade Level and Gender Differences in Computational Thinking and Programming Education
CT has been the central training goal of K-12 education for a relatively long time. However, most studies have focused on various types of programming tools in the CT development process, ignoring the focus on differences in students’ characteristics. In particular, grade level and gender, as the two characterizing factors that best represent students, have attracted numerous researchers’ attention (Demir-Kaymak et al., 2022; Sun & Liu, 2023). As a conglomeration of several cognitive abilities such as algorithmic thinking and abstract thinking, CT is necessarily directly affected by the cognitive development and mental maturity level of students (Gerosa et al., 2021). Some studies revealed that students’ cognitive abilities usually grow with age and grade level and with the full development of brain structures and functions. By extension, there is necessarily a correlation between students’ CT levels and grade levels. For example, several CT assessment tools were developed based on student’s grade level and cognitive ability level, including the TechCheck test for kindergarten and lower primary school students (Relkin et al., 2020) and the Bebras test for teenagers (Dagienė & Sentance, 2016), among others. Meanwhile, Román-González (2015) also stated that there is a positive correlation between students’ grade level and CT level. Demir-Kaymak et al. (2022) evaluated the CT levels of 436 Turkish middle school students using the Computational Thinking test and discovered that the CT scores of upper middle school students were significantly higher than lower middle school students. In addition, Kyza et al. (2022) conducted a four-day ScratchJr programming program for 51 elementary school students aged 6–12 years old to teach CT and programming knowledge such as looping and selection. The results showed that upper primary school students, aged 10–12 years, were significantly more capable of using CT and abstract programming concepts to solve problems than lower primary school students, aged 6–9 years. However, other characteristics of the student’s own or the external environment also have effects on the process of CT and cognitive development, thereby modifying the relationship between CT and grade level.
Student gender was also the most widely influential factor in the area of CT and programming education at the K-12 level. Wu and Su (2021) proposed that ensuring that students receive an equitable CT education is contingent on addressing gender disparities. Constrained by the historical influence of low female participation in the early stages of computer science development and the reality of men’s superior performance in math, science, and technology (Miliszewska et al., 2006), programming and CT have always been perceived as exclusively male fields and careers. Meanwhile, the stereotypes about CT in the socio-cultural realm have been gradually and invisibly transferred to the K-12 level, and this phenomenon has aroused the attention of the educational community. Hence, many researchers have begun to explore the impact caused by gender factors in programming and CT educational practices, but no unified conclusion has been reached so far (Sun et al., 2024). For example, Ameer and Singh (2013) used computational ability tests to evaluate the CT of 414 junior high school students in Malaysia and found that boys had significantly higher CT levels than girls, which also supports gender stereotypes. However, some researchers pointed out that boys are more susceptible to the negative effects of digital technology, such as technology addiction or overuse, which may hinder boys’ CT development (Ünal, 2020). Li et al. (2024) designed unplugged programming activities with board-based games and conducted a four-week intervention with 90 sixth-grade students. The results showed that girls were significantly better than boys in terms of engagement and CT levels in the unplugged programming environment. In addition, Sun et al. (2024) discovered that there was consistently no significant difference between boys’ and girls’ CT in either the unplugged or plugged-in programming environments. As shown above, there are contradictory results caused by gender factors in CT and programming practices. Therefore, it was necessary to further explore the impact caused by gender factors during the intervention of Python programming courses.
Research Questions
In summary, the major objective of this research was to explore the effects of Python programming course practice on CT of Chinese middle school students. Therefore, a 16-week pre- and post-test intervention study was conducted and students’ CT levels were measured before and after the intervention to evaluate the effectiveness of the Python programming course. Also, this research explored the influence of grade level and gender factors in the process of Python programming course practice. For this purpose, the following research questions (RQs) were proposed: RQ1: Do Python programming courses significantly improve CT for middle school students at all grade levels? RQ2: Are there significant grade level differences in the impact of Python programming courses on middle school students’ CT? RQ3: Are there significant gender differences in the impact of Python programming courses on middle school students’ CT?
Methodology
Research Context and Procedures
Based on the above research questions, this study implemented a 16-week Python programming course intervention for 79 middle school students in a public middle school in China. Specifically, we released a recruitment notice for the Python Programming Club Class to all students in the school, aiming to develop students’ understanding of Python programming knowledge and to promote the development of students’ CT. Eventually, 79 students voluntarily signed up for the club class. To be clear, the club class was not part of the formal curriculum but was an after-school course. Subsequently, considering the balanced distribution of students by gender and grade, we used complete randomization to divide the students into two classes. One class had 40 students (boys = 21, girls = 19) and the other class had 39 students (boys = 22, girls = 17).
In the experimental preparation phase, to ensure the homogeneity of environments for students in both classes, we strictly controlled the influence of factors such as the learning environment, instructor, and teaching content of the Python programming course. Specifically, we developed teaching guidelines for each course to ensure the consistency of the content and teaching process in both classes. We invited a teacher from the public school with many years of experience in teaching Python programming to teach the class. Also, we provided the teacher with three online training sessions to ensure that she can conduct the instruction concerning the design of teaching guidelines. In addition, we chose the same microcomputer room to implement the Python programming program, except that the instruction time differed between the two classes. This ensured consistency in the hardware equipment, such as computers and keyboards, and the programming software versions used by the students in both classes.
During the implementation phase, students in both classes received 16 weeks of Python programming intervention, which also included two CT-level tests. During the first week of the experiment, we began by describing the main pedagogical components and instructional objectives of the course. Meanwhile, an online questionnaire was released to all students that included the CT test and a demographic information questionnaire to collect information about students’ CT level, grade level, and gender before receiving the Python programming intervention. Consequently, students in both classes participated in a 14-week Python programming course, with one class per week, each lasting 40 min. During the last week of the course, an online CT test was again published to all students to assess students’ CT levels after participating in the Python programming intervention. Finally, we analyzed the collected data to determine the impact of the Python programming course on middle school students’ CT. The study process is shown in Figure 1. Study process chart.
Participants
Demographic Information for all Participants.
Instrument
Computational Thinking Test
In this study, we used the Bebras test to assess students’ CT, the validity of which has been recognized in nearly 90 countries worldwide. Specifically, the Bebras test is designed to assess the CT levels of students in the Kits (age 6–8), Castors (age 8–10), Benjamins (age 10–12), Cadets (age 12–14), Juniors (age 14–16), and Seniors (age 16–18) age groups (Bebras, 2024). The major reason for the global popularity of the Bebras test is that its questions combine CT with life situations and allow students to complete responses without ever having been involved in any programming language. Therefore, the Bebras test is generally recognized as an effective instrument for measuring students’ ability to use CT to solve real-world problems. Considering that Chinese middle school students are basically 12–14 years old, we selected 12 questions from each of the 2021 and 2022 Bebras tests designed for the Cadets’ age group as the pre-test and post-test instruments in this study. In each set of CT tests, six easy questions (5 scores each), four medium questions (10 scores each), and two difficult questions (15 scores each) were contained, with a full score of 100 points. Meanwhile, all questions were submitted in single-choice format, scoring points for correct answers and 0 points for incorrect answers.
Moreover, the original version of the Bebras test questions were all in English. To accommodate the linguistic background of Chinese junior high school students, this study invited two researchers with educational backgrounds and better English expertise to scope all the questions into Chinese, and two additional researchers were invited to back-translate them. The content of the original questions was compared with that of the back-translated questions to ensure the accuracy of the translation results. In addition, middle school IT teachers were invited to assess the content validity of the test questions, and they all agreed that the test questions were designed to reflect the CT level of middle school students. After students completed the pre-test and post-test, this study analyzed the difficulty, differentiation, and reliability of the CT tests using the Item Response Theory (IRT) package in the R language. The results showed that the Cronbach’s alpha of both sets of CT tests was greater than 0.7, which indicated that the CT test results had good consistency (Cronbach & Meehl, 1955); moreover, the difficulty (0.493 and 0.556, respectively) and the differentiation (0.324 and 0.392, respectively) of the test items were within the desirable ranges, which could more accurately reflect the CT level of middle school students.
CodeCombat Programming Platform
CodeCombat (https://codecombat.cn/) essentially is a website-based programming code learning platform that can operate without the support of complex information technology equipment. CodeCombat eliminates the weaknesses of abstraction and obscurity in traditional programming teaching by integrating programming learning into the process of game breakthroughs and small project development and currently supports the practice and teaching of Python, C++, and many other programming languages. CodeCombat provides built-in programming practice activities in six learning modules, including introductory programming, web design, game development, and others. In this study, we chose the “Kithgard dungeon” game levels in Introductory Computer Science, which contain knowledge of variables, loops, and functions in Python programming. CodeCombat also arranges the game levels according to the level of difficulty in understanding Python programming knowledge to ensure that students can progress step-by-step. Figure 2 shows the game level involving the concept of “variables” in Python. From the figure, we can see that there are three main areas in the game level, which are the game interaction area, code writing area, and code repository. Students are required to write the code according to the game’s objective and the functions provided in the code repository. After completing the code and clicking “Run”, the game character executes all the code sequentially, and then students are required to debug the code based on the interactive feedback. Example of Python programming game level.
Instrumental Design
Instructional Guidelines for the “Variables” Course.
As shown in Table 2, abstraction, deconstruction, algorithmic thinking, and evaluation skills in CT are involved in this course. For example, students used abstraction skills to understand that variables represent the name of specific game characters and can control the behavior of game characters through variables. Also, the game level involved a variety of different variables, and students also needed to use deconstructive skills to break down the task into smaller units and complete them sequentially, while algorithmic thinking refers to the order and logic in which students use variables. Debugging skills focus on the student’s ability to recognize incorrect code, including the use of undefined variables and incorrect variable assignments. Finally, students were assessed on their mastery of the variable concepts through more difficult tasks. In this process, students need to synthesize the above CT concepts to promote synergistic development of all CT dimensions.
Intervention Fidelity
Intervention fidelity, which is the degree of ensuring that instructional interventions and processes are implemented according to a pre-determined research protocol in a practice study. Improving the fidelity of programming instructional interventions is an essential prerequisite for ensuring the validity of measures of Python programming instruction and the reliability and replicability of research findings. In this study, to effectively validate the effects of Python programming instruction on middle school students’ CT, we controlled the interference of confounding variables in many ways to ensure the reliability of the findings. First, we ensured that the classrooms, computer configurations, desks and chairs, and other factors were consistent across different grades when students received Python programming instruction to minimize the interference caused by the instructional environment. Second, all Python programming lessons were taught by the same teacher to reduce the variation in teaching effectiveness caused by different teachers. Third, we designed a detailed teaching plan and process for each Python programming course, and rigorously trained the instructor before conducting the experiment to ensure that he could teach according to our expected design. Finally, we also made sure that the CT assessment environment was consistent for all students to ensure the accuracy of the assessment results. Overall, this study has gone to many lengths to control or eliminate the influence of extraneous factors on middle school students’ CT to ensure the reproducibility of the findings and the transferability of the study’s conclusions.
Data Collection and Analysis
This study collected information about students’ CT levels their grades and gender before and after participating in the Python programming course intervention. All quantitative data analysis was completed with SPSS 29.0, while the visual presentation of the data analysis results was completed with Origin 2024 (student version). First, we used descriptive statistical analyses to present the CT scores of students at each grade level. Second, we used a paired sample t-test to analyze the effect of Python programming courses on students’ CT development at each grade level. Again, the two-way ANOVA was used to determine if there were interaction effects of students’ grade level and gender factors in influencing CT. To clarify, since there were interaction effects of grade and gender factors in the CT pretest, we used simple effects analysis and post-hoc tests to explore the effects of grade and gender factors. There was no interaction effect between the grade and gender factors in the CT posttest, therefore we used the one-way ANOVA to explore the effect of the grade factor and the independent samples t-test to explore the effect of the gender factor.
Results
Development of Student’s CT
Students’ CT Scores.
Paired Samples T-Test Results for CT Scores.
Note. * = p < .05, *** = p < .001, CI indicates confidence interval.

Visualization of Paired Sample T-Test results for CT scores.
Effects of Grade Level and Gender on Students’ CT
Interaction Effects Analysis of Grade and Gender Factors.
Note. MS stands for Mean square, A stands for grade, B stands for gender, and A*B stands for the interaction effects of grade and gender.
Results of the Post-hoc Test Analysis of Grade Factor (Pretest).
Note. SE indicates standard error, CI indicates confidence interval.

Visualization of the results of grade factor analysis.
Results of the Post-hoc Test Analysis of Gender Factor (Pretest).
Note. *** = p < .001.

Visualization of the results of gender factor analysis.
One-Way ANOVA Results for Grade Level Factors (Posttest).
Note. * = p < .05, SE indicates standard error, CI indicates confidence interval.
Independent Samples T-Test Results for Gender Factor (Posttest).
Note. * = p < .05, *** = p < .001.
Discussion
In response to the first RQ, the present study found that the Python Programming Curriculum Intervention was effective in promoting significant increases in CT among middle school students at all grade levels. This finding was supported by numerous studies. For example, Bai et al. (2021) designed a problem-based Python instructional model for 30 eighth-grade students and found that students’ mastery of concepts and ideas about CT increased significantly. Kamak and Mago (2023) designed block-based Python programming curriculum for 7th and 8th grade students in Canada and measured students’ CT levels using the Computational Thinking Test (CTt), and found that students’ CT improved significantly after the curriculum. However, the findings of Kroustalli and Xinogalos (2021) concluded the opposite of the present study. They implemented three consecutive 45-min Python programming lessons for Greek seventh-grade students and found that the students’ CT skills were not significantly improved. The reason for this phenomenon could be attributed to the differences in the systematic nature of the design and implementation of the Python programming program. In this study, 16 weeks of Python programming activities were implemented to develop students’ CT in a systematic and progressive manner. The discoveries of this study not only demonstrate the effectiveness of a systematic Python programming curriculum designed based on the CodeCombat platform at the middle school level in China, but also provide new ideas for conducting Python programming in other countries.
After the end of the Python Programming Program intervention, eighth graders had significantly higher CT levels than seventh and ninth graders, while there was no significant difference in CT levels between seventh and ninth graders. This discovery is contrary to some current research findings. Some researchers reported that students’ CT showed an increasing trend with age, and typically students in higher grades tended to have higher CT (Kong & Wang, 2023; Sun & Liu, 2023). Practically speaking, students complete Python programming tasks that require some cognitive abilities and knowledge base. From the viewpoint of cognitive development theory, students in middle school are in the critical period of development of the formal operations stage. Their ability of abstraction, logical thinking and deductive reasoning is increasing, and the developmental capacity of CT should supposedly show an increasing trend (Fischer, 1980). However, the pressure of promotion for ninth graders may lead to an over-consumption of cognitive resources, which in turn inhibits the development of higher-order thinking such as CT (Kirkpatrick & Zang, 2011; Pellas, 2023). Actually, from the perspective of cognitive neuroscience, some researchers have pointed out that students’ temporal lobe structures mature before the age of 14 (Matsuzawa et al., 2001); also, eighth-grade students’ are at the peak of prefrontal myelination (Sowell et al., 2004), and students’ abstraction and working memory capacity are both significantly improved. Moreover, in terms of self-efficacy theory, the difficulty of the Python programming curriculum designed in this study was probably more appropriate for eighth-grade students, creating the positive cycle and continuous motivation for intrinsic CT development, while it was either too difficult or too easy for seventh- and ninth-grade students (Ling et al., 2021). This may also explain why eighth graders perform better on CT. Therefore, we further advocate that future implementations of Python instruction also adapt the curriculum content to the grade level of the students.
Analyses targeting the gender factor revealed that after the Python programming intervention, CT differences due to gender were observed in both the eighth and ninth grades, and girls performed better in CT. The findings disrupted previous research in CT that supported gender stereotypes. For example, Mouza et al. (2020) explored the development of CT in 138 students using a mixed-methods research approach and found that CT was significantly higher in boys than in girls both before and after the programming intervention. Meanwhile, some researchers have also provided evidence that middle school girls have significantly better CT than boys (Ameer & Singh, 2013; Tsai et al., 2020), or that there is no significant difference in CT between boys and girls (Price & Price-Mohr, 2023; Sun et al., 2024). We provide key evidence to break gender stereotypes in CT and demonstrate that the right programming approach can fully stimulate girls’ potential for CT development. The findings of this study are supported by Ardito et al. (2020) who found that girls performed significantly better than boys on CT at the end of the LEGO Text Programming course. Some researchers have conducted studies from a cognitive neuroscience perspective and found that the reason boys and girls show differences in cognition and thinking is because of significant differences in the developmental rate of each brain region (Gur et al., 2012; Rijke et al., 2018). Middle school girls’ brains performed significantly better than boys’ when performing abstract, spatial tasks, which may also explain why girls perform better on CT. This showed that Python text programming has the potential to serve as an effective way to disrupt gender stereotypes and promote equity in the field of CT and programming education.
More interestingly, we also observed an interaction effect between gender and grade level factors. Specifically, significant differences due to the gender factor were found in both eighth and ninth grades, but this phenomenon did not exist in seventh grade. This showed that gender differences in Python programming courses change with grade level and have a larger impact on upper-middle school students. However, Ameer and Singh (2013) identified the most significant differences in CT caused by gender among lower middle school students, whereas there were no significant gender differences in CT among upper middle school students. This research finding was contrary to the current study’s findings. However, some of the research conclusions also support our findings. Qian and Lehman (2016) found that gender differences in computer science and CT exhibited by K-12 students become more apparent with age. From the perspective of socio-cultural theory, gender roles are shaped by the culture of the society (Harper, 2000). In a survey of 297 primary and secondary school students in Taiwan, She (1998) found that boys increasingly believe they can perform better in science-based fields as they get older, and eighth graders in particular are most affected. Eighth-grade girls, on the other hand, feared being labeled as inferior to boys in computer science, an influence that could even have a significant impact on career choices. In contrast, seventh graders are still in the early stages of understanding social roles and are less exposed to the sociocultural influences of gender stereotypes. However, according to the findings of Gur et al. (2012), girls even outperform boys in terms of their skills in solving abstract and spatial problems. This shows that girls show even significantly better CT skills than boys if the negative effects of gender stereotypes are overcome. Therefore, future educators should use appropriate measures to eliminate the effects of gender stereotypes when teaching CT and programming in middle schools to provide equitable opportunities for girls and boys to develop in CT.
Implications for Future Practice
This study enriched the impact of Python programming on middle school students in the Chinese educational context. First, this study designed a series of detailed teaching contents and teaching processes for a Python programming course based on the CodeCombat platform, which can be used as a teaching resource for frontline teachers at the junior high school level to conduct CT education. We demonstrate the effectiveness of the curriculum and advocate education authorities to introduce the CodeCombat platform into the IT curriculum or club curriculum. Also, teacher training should be organized to help them master the use of the CodeCombat programming platform and equip them with the appropriate teaching skills. Second, we also found heterogeneity in the effects of Python programming activities on the CT of middle school students at different grade levels. We suggest that educators should design personalized instructional content to meet the CT developmental needs of students in different grades based on their needs before conducting Python instruction. Finally, we found that middle school girls performed significantly better than boys in CT in Python programming, and there was no gender stereotype as some researchers assumed. Moreover, the difference in CT caused by the gender factor became more obvious as the students’ grade level increased. The above findings may provide key evidence for frontline teachers to understand the influence patterns of gender and Python programming curriculum design for middle school students. In addition, we recommend that teachers incorporate the concept of gender equality in Python instruction, especially to reduce the resistance and intimidation of senior female students in CT and to create a fair educational environment for them.
Limitations and Future Direction
There also exist three limitations in this study. First, this study only used a quantitative approach to measure students’ CT development and was not able to discuss and validate the results of the quantitative analysis with qualitative data. In future research, we will use a mixed research method to measure students’ feelings of CT learning through interviews and changes in CT levels through test questions to provide comprehensive and insightful understanding of students’ CT development. Second, the small sample size of this study and the fact that the curriculum was designed for middle school students in China may affect the generalizability of the findings. In future studies, the research sample should be expanded and experiments should be conducted in schools in different regions to improve the generalizability of the findings. Once again, this study focused on the overall changes in students before and after receiving the Python programming intervention, neglecting to focus on the types of errors that occurred during student testing. The next study should fully consider the development of students’ CT skills in all dimensions and tap into the focus and difficulty of developing students’ CT. Finally, the Bebras assessment tool used in this study focused on students’ ability to use CT to solve real-world problems and neglected to assess students’ ability to write Python code. Therefore, it is necessary to use assessment tools that specifically measure students’ Python programming ability and CT in future studies to achieve a comprehensive evaluation of students’ abilities.
Conclusion
Python programming has gained widespread attention as an effective way to develop CT, but its effects on students at different grade levels vary. In this study, we used an experimental design of pre- and post-test to investigate the impact of Python programming courses on the CT of 79 junior high school students in China. We also explicitly identified differences in CT caused by students’ grade level and gender factors, aiming to expand the researchers’ understanding of Python programming. The results of the programming practices showed that a 16-week Python programming course was effective in promoting the CT of Chinese seventh, eighth, and ninth graders, and was more favorable to the CT development of eighth graders. Meanwhile, the findings also indicated that the gender factor caused significant CT differences during the Python programming course intervention and was more advantageous to girls in the eighth and ninth grades. Moreover, we found significant interaction effects between middle school grade level and the gender factor, with CT differences resulting from the gender factor becoming more significant with increasing grade level. This study enriched the findings of Python programming’s impact on middle school students’ CT from the practice perspective and provided scientific evidence for CT educators to design individualized Python programming interventions.
Footnotes
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
Ethical Statement
Data Availability Statement
The data supporting the results of this study can be obtained from the corresponding author on reasonable requests.
