Introducing the concept of sequencing in coding

02.26.2021

Experiment leads: Joseph and Meghna

In this visit, we built upon the Python turtle concepts introduced in SFA’s first virtual visit. After a quick recap of the concepts covered in the first visit, we introduced the activity of fixing a given code to draw a house. Students in pairs were put into breakout rooms with a mentor and were asked to work on fixing the order of drawing objects using Python Turtle. 

Trinket.io, which is a website that allows code to be run directly from a web browser, was used for this activity. A URL of the code was shared in the breakout rooms. The concept of sequencing in code was introduced, which could be seen visibly as the turtle rendered objects in the order the corresponding functions were called.

 

Sequencing

Students were asked to play around with changing the order of functions and see what happens. The concept of functions was re-introduced, along with highlighting the importance of naming functions such that anyone who looks at a function name can get an idea of what the function is supposed to do. 

Below is the fixed code by one of the students where the windows are placed in the correct locations, the grass is behind the house, the fence is visible, etc. 

 

Sequencing in coding

We also introduced some challenge activities next, where the students were asked to look at the function definitions and change things like the color of the door, roof, etc.

The students could continue playing around with the code on their own and make modifications like changing the shape of windows, adding more clouds, bushes, etc.

ghosh115