Coding Python
Home›Python Coding Games›Python Farmer

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

  1. Each level tells you what to grow. Commands include plant(), water(), move(), sleep() and harvest().
  2. Write the plan in the editor; sleep() ends the day and the crops grow overnight.
  3. Later levels add is_ready() and grow_days(), so your program has to check before it acts.
  4. Harvest everything asked for, on time, in as few lines as you can.

All 6 levels — what each one teaches

#LevelPython ideaGoal
1First HarvestCalling functionsGrow and harvest 1 carrot.
2Radish Rowfor loopsPlant, grow and harvest all 6 radishes.
3Giant SunflowerVariablesHarvest the sunflower not a night too early or too late.
4The Big FieldFunctionsBy morning, all 12 plots should have fully grown radishes.
5Morning Choresif statementsHarvest every ripe crop and water every growing one.
6Pumpkin Contestwhile loopsHarvest 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.

Prefer to code on your phone? Keep practising on Android: the free Coding Python app is a full Python 3 editor and interpreter with 30 examples and 12 challenges.
Get the free app

More Python adventure games

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
Coding Python app icon