Python the Calculator
Do farm math and solar-power math in a flash.
Python the Calculator 🧮
Farmers, engineers and space scientists do a LOT of math. Python can do it in a blink.
| Symbol | Means | Example | Answer |
|---|---|---|---|
+ | add | 5 + 3 | 8 |
- | subtract | 10 - 4 | 6 |
* | multiply | 6 * 8 | 48 |
/ | divide | 10 / 2 | 5.0 |
print(5 + 3)
print(6 * 8)💡🧠 Dividing with
/always gives a number with a dot, like5.0.
🌽 Farm math
A farmer plants corn in rows. How many plants is that?
rows = 12
plants_per_row = 20
total = rows * plants_per_row
print("Corn plants:", total)That shows Corn plants: 240. Imagine counting that by hand!
☀️ Solar power math
Solar panels turn sunlight into electricity, with no smoke and no pollution.
panels = 4
energy_per_panel = 3
print("Energy today:", panels * energy_per_panel)Math with variables
You can change a box using its own value:
apples = 10
apples = apples + 5
print(apples)That prints 15. Python works out the right side first (10 + 5), then puts the answer back into the box.
💧 Fun fact
Growing food uses a lot of water: farming uses roughly 70% of all the fresh water people take from rivers and lakes. That's why farmers use code and sensors to water plants only when they need it!
Type it yourself
Don't just read it — type the example from above into the box, press Run ▶, and watch what happens. Typing it yourself is how it really sticks! Stuck? Tap Show example.
Press ▶ Run to see your code come to life…