Is there life after Scratch, or how to introduce a child to Python

At EPAM we have a programming school for employees' children - e-kids. At the school, volunteer employees teach children to work with Scratch, a visual programming environment designed specifically for teaching children and adolescents. But always, sooner or later, the moment comes when Scratch is already becoming not interesting for children.

Through trial and error, our teachers managed to find a way how to develop children further, what to teach, so that they would not lose interest in programming because of too complicated tasks. So in e-kids began to teach a more complex programming language - Python. In this article, I gathered useful information from colleagues who teach at school about how to introduce children to Python.



Scratch is a visual programming environment, there is no need to enter the code manually, you can quickly get the result, children can immediately see how the project changes after a new block is added. With Scratch, you don’t have to spend time searching for letters on the keyboard, it also eliminates the painful search for syntax errors in the project.

But when the child has already learned enough about Scratch, he begins to lose interest in work. The tasks begin to be repeated, Scratch cannot surprise anyone with anything new - which means it's time to think about moving from Scratch to some programming language, where you can start writing code.

When choosing a language, you should pay attention not only to the experience of children, but also to their age. According to the experience of e-kids teachers, the minimum age for children to offer them to write code is 11-12 years.

Training preparation


Why python
Python has simple syntax and a large community. If the child has difficulty with the decision, you can easily find the answer on the Internet. And also there are many external sources, tasks, resources that can be used for independent study.

Helper programs


For the preparation of lessons or homework, special services were sometimes used.

  • Code.org - the service contains ready-made tasks and a description of how to solve them. These tasks can be categorized by operators, loops, functions, etc.
  • CodeCademy , Python, . .
  • Code Combat β€” , RPG , . Python, , . , Scratch Python .
  • Kahoot - this service will stand out a bit from the rest, since it has nothing to do with Python, but it is a very wonderful service to remember what happened in the last lesson. Kahoot can be used at the beginning of each lesson so that children remember the keywords, approaches, technologies that they talked about earlier. It allows you to create a list of questions and answer options. In addition, there is a mobile application that connects to the quiz, so children can answer from phones.

All of them are in English, but free of charge.

Helper Books


Of all the variety of books, e-kids teachers recommend these:

  • Python for children: Self-taught Programmer , Briggs Jason.
  • Python programming for children , Louis Stowell.

Both books are written in a language that is understandable to children. Plus they contain very interesting tasks.

Is an Integrated Development Environment (IDE) needed or not?
IDE , , , , Python. , , PyCharm 2018.2.4 (Community Edition) β€” IDE.

Console vs Graphics


Everyone is accustomed to β€œHello, world” usually typing in the console, but when the children see the console, they immediately become discouraged.



Therefore, it is better to use libraries such as Turtle and Tkinter. Both are part of the standard Python distribution and do not require additional installation. It will be easier for children to switch to Python through these libraries, because many methods repeat blocks in Scratch.



Turtle is easy to customize: the background can be replaced with a picture of the room, and the turtle with another character.



The Tkinter library, in turn, allows you to write window applications; it already contains many primitives with button switches, switches, flags, menus, etc. So, combining Turtle and Tkinter, you can already write a simple game.

How to write a game in Python


Let me show you an example of how the children got acquainted with Python in the lessons at e-kids.

  1. First, the children were introduced to Code Combat. Here the character can walk on the map, collect crystals, dodge enemies with the help of a code. This is a simple game, but the children already wrote pieces of code, and most importantly, they could immediately see what it affected.
  2. Then they introduced the children to the "turtle." They taught her to walk, write, and painted different fractals.
  3. After which we tried to turn Scratch blocks into Python code.

For example, the Scratch cat was described by the addHero function with a picture, which was passed as an argument to this function.



In another block, the children described a function where our hero was an argument, indicated that he should say how long and what color the inscription would be.

Thus, combining these blocks, the children could already write a game similar to the ones they developed on Scratch. Some of the blocks are already in the Turtle library, some were added on their own.

The code that the children wrote was something like this: there is a background image, a hero, phrases that he says, and garbage that the character could collect.



In a separate block, we described the logic - the character collects garbage, if he is close to the garbage, he says some kind of phrase. This is very similar to how character logic is described in Scratch. There, you can also open the character and add some blocks of behavior, after which the character came to life.



In the lessons, children are given a variety of tasks, both the development of the game and the correction of errors. For example, you can mix the blocks, then the program stops working, and give the children the task of finding what is wrong, in what order the blocks should go.

The trial and error path


Some people choose JavaScript or Java instead of Python. At one of the e-kids courses, teachers decided to try to make out with Flask, a framework for creating web applications in Python, but this idea crashed. The tasks were too ambitious: to show how to create a website with a blog, gallery and guestbook. Although the structure of all these components was similar, it would seem that the children could just change something on the blog and make a gallery, for example. But teachers faced a lot of problems:

  • We found out that it’s difficult for children to explain what frameworks are in principle. Moreover, it turned out to be difficult to explain even to some adults.
  • Children had to work with a large number of files, as a result they were confused where to insert what.
  • High entry barrier. To explain how to build such a web application, children had to know a large number of technologies, including about working with databases.


Despite the fact that the average age of the participants was 14-15 years old, and they already had experience with Python, almost half of the group members lost interest in Flask classes, the children did not show activity, they simply rewrote what they were given and did not dive into topic.
But it cannot be said that it was a complete failure, it was a rewarding experience.

Conclusion


Technology is becoming an important part of our lives. Code is the language of our world, which combines mathematics, logic and algorithms and teaches a new view of the world.

Programming teaches how to solve big problems, breaking them down into a sequence of smaller, more manageable problems. We hope that our classes help children solve problems more efficiently and think globally.

The e-kids program is developing in Russia, Ukraine, Belarus and Kazakhstan. In 2019, 203 students, children of employees, were trained in Russia. In addition, since September 2019, we began to deal with children from orphanages and with disabilities. More than 80 employees volunteered for the program.

For various reasons, employees become volunteers: many of them have children, and development parents want to show them IT on the other hand or fill in the gaps in school education, and someone just likes the learning process.

All Articles