Easy problems for children solved in Python

I am going to teach 9 and 10 Python students over the coming years and thought it would be great to make problems like Project Euler with them. The first problem seems to be doable by them, but I think that some of them may be a little overhead or do not require enough programming.

If someone has a place where you can find some easy programming problems or they might think about them, let them please let me know.

edit: By 9 and 10 years old, I mean that they have been at school for 9 or 10 years. So, age 13, 14 and 15 years. Sorry for the confusion!

+6
source share
4 answers

Oh, I remember what I was taught at school! My IT teacher created a class in python whose attributes created a mathematical sequence. The goal was to guess the formula of this sequence using only python. Obviously, you could not look at the file with the class, but only import it into python. Maybe there is more mathematics than programming, but to solve this question, students will need to learn how variables, namespaces (to search for variables), loops (to print these variables) and classes (which store these variables) work in python, and that’s more or less all you need to know first, in my opinion.

Ah, good times. We also played hide and seek in a shell at IT lessons: the teacher hid the file somewhere and left some hints scattered around, and we had to find this file using the text environment in Linux :)

+2
source

Get the correct number:

The program selects a random betwen value of 1 100, after which you should guess. It tells you whether you are above or below.

+1
source

My first contact with the programmer actually left a mark for me;) The teacher provided us with a gui containing a kind of 2-dimensional checkered board (let it pretend to be 20x20 cells). One of the cells contained a "robot", and the programming interface basically revealed 3 methods: move forward, turn left and check whether the cell directly in front of the robot is a wall or open space. Then the game was supposed to “program the robot” (by teaching the basic logic and construction of the cycle) to perform all kinds of tasks, for example, to go through each cell on the board. Later, methods were added to the interface (to the original 3 methods) and "objects" (not OOP, but ... other states that cells could occupy, not just walls or empty) were added to the game. As a result, the goals were, for example, so that the robot "took" the car parts and brought them to the "car factory". It was really nice that IMHO saw programming as a “graded” game (the fewest cells needed to achieve the goal in this case), and I really promote Gamification http://en.wikipedia.org/wiki/Gamification in any school environment .

Greetings

+1
source

Not sure how long you should learn this, but the Udacity cs101 class has some pretty interesting problems and starts at a fairly simple level. The course is free, and you may find some problems useful offline if you do not have time for all this.

Finally, if you run out of ideas for meaningful projects that are light enough / fast enough in Python or decide to find something easier for part of the class, then consider using Scratch , this is a fun visual programming language from MIT that allows you to use constructs, such as variables, loops, conditions, etc., without worrying about the syntax. This makes it easy and simple to create basic games / animations.

+1
source

Source: https://habr.com/ru/post/951383/


All Articles