My way to introduce junior high school students to Python

Nowadays, most children get acquainted with the world of programming through creating projects on the platform scratch.mit.edu Creating projects occurs by connecting multi-colored blocks without entering code from the keyboard (we enter only the values ​​of the variables).

However, children grow up, they become crowded in the world of Scratch, and at this moment they can offer several ways of development.

Some, like my son Artyom, having plenty of work in the Scratch graphic editor, choose a circle of fine art.

Other guys who are fans of 2D games continue to make more professional games on the Construct platform .

Well, programming fans can be advised by Python, because it is one of the simplest languages ​​to learn. But what about, after all, primary school students are completely unfamiliar with the keyboard?

Here is an example of a simple Scratch project in which a child enters only 2 numbers from the keyboard.



In "adult" programming languages, you have to type a lot more text from the keyboard, but there is a way to make life easier for children when moving from Scratch to Python.

Why to Python?
Pascal Basic, hh.ru Python.

, IT,
5 807 «Python»
262 «Pascal»
44 «VB.NET»

Pascal hh.ru Delphi, PascalABC, .
( PascalABC pascalabc.net/rubantsevbooks )

A couple of years ago, I decided to introduce my students to Python and started looking for literature on this topic. There were very few books on Python for children, and not one of them completely satisfied me - I had to invent everything myself again, like the stories about Scratch habr.com/en/post/234823 .

What is wrong with these books? The common problem is there is a lot of code. And if this is not critical for high school students, in 20 minutes they will be able to put together a program for 30-40 lines, then for elementary school students this is a huge problem.

Also, the projects themselves, which are offered in books, in my opinion, are not very suitable for elementary grades.

A small review of the literature with my personal rating.

A small review of the literature with my personal rating
3
Python for Kids archive.org/details/PythonForKids/mode/2up
vectorplus .
“ , , . , . — . — — . .” habr.com/ru/post/485424
: , , 20 , 60 ( 6 ), .

2
Python : -
www.litres.ru/hans-georg-shuman/python-dlya-detey-48411263
, 40 . .

1
, , : . Scratch Python www.labirint.ru/books/481230
Scratch ( 3 ) Python (4 ). , , . 10-12 , .

Having not found a suitable textbook on the Internet, I came up with my own way to introduce children to Python, and the trinket.io platform helped me in this .

On this platform, it is possible to work online with the following programming languages:

  • Blockly language Blockly
  • HTML
  • GlowScript
  • R
  • Java
  • and of course Python

and in the paid version ($ 3 per month) you can use Pygame to create games!



And the main discovery for me was that the block trinket turns into Python code in three clicks! First click to view code.



A couple more clicks are converting a block trinket to a Python trinket.



Done!

The student receives a program in Python that he created without a long painful search for characters on the keyboard. Now the teacher can draw analogies with the block language, talk about the syntax and give the task to change the coordinates so that the square turns into a rectangle.



Also now the child can "copy-paste" to assemble a more complex project, such as this one with drawing a picture.



This is how my Python course came about.for elementary school students in which they get acquainted with this programming language. We do not create complex projects, we work within the 45 minute lesson. We take a fresh look at the cycles and conditions that are familiar with Scratch programming, deal with numerical and text variables that we had never thought of before. We get acquainted with complex data types, learn to work with slices and various methods. To make it interesting for children, in addition to patterns with a turtle, we create pictures from ACSII characters, draw Kaomoji emoticons and create pictures from Unicode characters.

Kitty with a list.



Caterpillar with two lists.



Unicode character picture with dictionary.



Work with objects.



And of course, my favorite Confusion game is simple, but very fun!



The trinket.io platform is an excellent assistant in introducing Python students to elementary school students. But not so long ago, I discovered another gorgeous platform that allows you to program in Python in the world of Minecraft. This is the platform progkids.com created by domestic developers. The platform is paid, but recently the authors of the platform posted on Facebook a promotional code FREESELFCOURSE which gives two weeks of access for free.

Under this platform, I also developed a bunch of codim.online/pythonvm lessons that allow you to master more complex topics, such as nested loops and multidimensional arrays.

from mc import world, blocks, player

for i in range(5):
	for j in range(5):
			for k in range(5):
				world.buildHome(5 + (j * 5), 0 + (k * 5), 0 + (i * 10), 5, 5, 5, blocks.WOOD)



Draw emoticons using arrays.

from mc import *

heart = [ [[	0,   0, 152,   0,   0],
			[   0, 152, 152, 152,   0],
			[ 152, 152, 152, 152, 152],
			[ 152, 152, 152, 152, 152],
			[   0, 152,   0, 152,   0]] ]

scull = [[  [   0, 173, 173, 173,   0], 
			[   0, 173, 173, 173,   0],
			[ 173, 173, 173, 173, 173],
			[ 173,   0, 173,   0, 173],
			[   0, 173, 173, 173,   0]] ]
					
world.setBlocks(0, 3, 0, sad)
world.setBlocks(0, 3, 7, heart)
world.setBlocks(0, 3, 14, scull)
world.setBlocks(0, 3, -7, butterfly)



The platform has a bunch of built-in functions that make building easier, allows you to spawn creatures, control drones, build cities, ~~ rob cows ~~, dig the metro, build tunnels and bunkers, cover everything with dynamite and ... and do much more!



You can also create animated buildings, such as watches.



Show these platforms to children, I am sure they will be able to make many interesting projects for the joy of teachers and parents.

And in honor of the day of the vernal equinox and the onset of the astronomical summer, to all readers as a gift the first 8 lessons of the Python acquaintance course using the promotional code PYTHON2020.

All Articles