This repository contains a very simple Python program designed for children who are learning programming.
For example, using the arrow keys on the keyboard, the player can move a block around the screen.
The code is intentionally small and easy to read, so beginners can understand:
- how to read keyboard input
- how to update a position on the screen
- how to run a basic game loop
Feel free to use this as a starting point for teaching or for creating your own small games.
This repository contains a beginner‑friendly calculator program written in Python using tkinter.
It displays a simple calculator window where kids can type or click buttons to do math.
- How to build a GUI with
tkinter - How to create buttons and input fields
- How to handle keyboard and mouse input
- How to evaluate math expressions safely using
ast
- Supports basic operations:
+,-,*,/,%,//,**, and parentheses - Buttons for digits, operators, clear (
C), backspace (⌫), and equals (=) - Keyboard input also works (type directly or press Enter)
python Calc.pyThis repository contains a very simple Python program for kids who are learning programming.
It uses tkinter to draw a small toy car on the screen, and the car can move left and right using the arrow keys.
- How to create a window using
tkinter - How to draw shapes (rectangles, circles, polygons)
- How to detect keyboard input
- How to update objects on the screen in a loop
python Motorcar.pyThis is a simple Python game made with pygame, designed for kids who are learning programming.
An airplane appears on the screen, and you can move it freely using the arrow keys (or WASD keys).
- How to open a game window with
pygame - How to load images from files
- How to read keyboard input continuously
- How to move an object smoothly using time (
dt) - How to rotate an image to match the movement direction
- Left / Right / Up / Down → Move the airplane
- A / D / W / S → Also works
- ESC → Quit the game
Install pygame first:
python -m pip install pygameClick the “Code” button and select “Download ZIP” to download all files as a ZIP archive.
This repository contains three simple Python programs designed for kids who are learning programming.
They are intentionally easy to modify so children can experiment, customize, and learn by trying things out.
Here are some example ideas for what they can change:
- Add subtraction, multiplication, or division
- Change the button colors or sizes
- Adjust the font size of the input field
- Make the result appear larger
- Create a “quiz mode” that asks math questions
- Change the color of the car
- Adjust the speed of the movement
- Change the color or thickness of the road lines
- Make the car move left and right
- Replace the rectangle car with another shape
- Change the speed of the airplane
- Replace the background image with another picture
- Resize the airplane image
- Modify the key controls (not only arrow keys)
- Use your own drawing instead of the airplane image
- These programs are designed for beginner-level learning, especially for kids.
- Tested on Python 3.9–3.12. Other versions may behave differently.
- The Pygame example requires:
pygameinstalled (pip install pygame)background.pngandairplane.pngplaced in the same folder as the script- A display environment (may not work on headless servers)
- The Tkinter examples require:
- A desktop environment (Windows / macOS / Linux)
- Japanese fonts may appear differently depending on the OS
- These examples are intentionally simple and do not include:
- Error handling for advanced edge cases
- Mobile or web support
- High-performance rendering
- The code is meant for learning and experimentation, not for production use.
子供向けのシンプルなPythonコードです。プログラミング学習をしているお子さん向けに作りました。このコードを自由に作り変えて、学習に役立ててください。
実行すると電卓が現れます。
実行すると矢印キーで動く、自動車が現れます。
実行すると矢印キーで動く、飛行機が現れます。
- 👉 ariplane.png ファイルと、background.png ファイルを同じフォルダに置いてください
- 👉 実行する前に、Windowsのコマンドプロンプトでこのように入力して、pygameをインストールしてください。
python -m pip install pygame- 👉 Windowsのコマンドプロンプトを起動するには、タスクバーの検索ボックス(虫眼鏡の形のアイコン)に「cmd」または「コマンドプロンプト」と入力します。
このリポジトリに入っている 3 つのプログラムは、子どもが自由に書き換えて遊べるように作っています。
以下は、学習のきっかけになる「変更してみると楽しいポイント」の例です。
- 飛行機のスピードを変える
- 背景画像を別のものに差し替える
- 飛行機の大きさを変える
- キー操作を「上下左右」以外に変えてみる
- 飛行機の画像を自分で描いた絵に置き換える
- 車の色を変える
- 車の動く速さを変える
- 背景の線の色や太さを変える
- 車が左右に動くように改造する
- 車の形を四角形から別の形に変える
- 足し算だけでなく、引き算・掛け算・割り算を追加する
- ボタンの色や大きさを変える
- 入力欄のフォントサイズを変える
- 計算結果を大きく表示する
- 自分で「問題を出すモード」を作ってみる
「Code」ボタンをクリックして「Download ZIP」を選択すると、zipファイルとしてダウンロードできます。
