Python Farming Game: Python Farmer
Plant, water, sleep, harvest — a cosy farming game where every chore is a line of Python.
About this python farming game
If you enjoyed The Farmer Was Replaced — the Steam game where you automate a farm with a Python-like language — Python Farmer is a small, free cousin that runs in the browser and uses real Python 3. It is built for beginners: six short levels, one idea each, and a farmer who walks home to sleep each night and back to the field each morning while your program runs. Crops only grow when watered, and a giant sunflower or a pumpkin harvested a night too late will not count.
How to play Python Farmer
- Each level tells you what to grow. Commands include
plant(),water(),move(),sleep()andharvest(). - Write the plan in the editor;
sleep()ends the day and the crops grow overnight. - Later levels add
is_ready()andgrow_days(), so your program has to check before it acts. - Harvest everything asked for, on time, in as few lines as you can.
All 6 levels — what each one teaches
| # | Level | Python idea | Goal |
|---|---|---|---|
| 1 | First Harvest | Calling functions | Grow and harvest 1 carrot. |
| 2 | Radish Row | for loops | Plant, grow and harvest all 6 radishes. |
| 3 | Giant Sunflower | Variables | Harvest the sunflower not a night too early or too late. |
| 4 | The Big Field | Functions | By morning, all 12 plots should have fully grown radishes. |
| 5 | Morning Chores | if statements | Harvest every ripe crop and water every growing one. |
| 6 | Pumpkin Contest | while loops | Harvest all 3 pumpkins without letting any rot. |
New to these ideas? Each level pairs with a free lesson: loops, variables, functions and conditions. When you finish, try Treasure Hunter next.
More Python adventure games
- Python adventure game — Python Quest
- Python space shooter game — Code Defender
- Python turtle online — Python Painter
- Karel python — Robot Factory
- Python treasure hunt game — Treasure Hunter
- Python math game — Math Island
- Python rocket game — Space Explorer
- Python strategy game — Castle Builder
- Python string game — Word Locks
Or browse all the Python coding games.
Frequently asked questions
Is Python Farmer The Farmer Was Replaced?
No. The Farmer Was Replaced is a separate paid game on Steam by another developer. Python Farmer is an independent free game with a similar idea — farming by writing code — made for complete beginners and played in the browser.
What are other games like The Farmer Was Replaced?
Games where you automate by programming — robot puzzles, factory games and code-driven adventures. On this site, Robot Factory and Castle Builder are the closest in feel.
Is it free, and do I need to sign up?
It is free with no account. The game runs in your browser and saves your progress in this browser only.
Does it run real Python?
Yes. Your code runs on CPython compiled to WebAssembly (Pyodide) inside the page. Errors are real Python errors, and an endless loop is stopped after a few seconds instead of freezing the tab.
Does it work on a phone?
Yes. On narrow screens the editor sits at the bottom of the game. For longer coding sessions on Android, the free Coding Python app has a full Python editor.
Take Python with you
Coding Python packs a real Python 3 compiler, 30 example programs, 112 quiz questions and 12 self-checking challenges into one free Android app.
Get it on Google Play