0Pricing
Coding for Kids · Lesson

Doing the Math

Add, subtract, multiply, divide.

Doing the Math is a free Coding for Kids lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Time for Math! ➗

Hi number ninja! 🥷 Now that we can get two numbers, let's DO math with them! ➗

Computers are super fast at math. Let's learn the four big operations!

a = 10
b = 4
print('Our numbers are', a, 'and', b)

Adding With + ➕

The plus sign + adds numbers together! ➕ Easy peasy!

a = 10
b = 4
print('Sum:', a + b)

Subtracting With - ➖

The minus sign - takes one number away from another. ➖

a = 10
b = 4
print('Difference:', a - b)

Multiplying With * ✖️

Remember the star? * means multiply (times)! ✖️

a = 10
b = 4
print('Product:', a * b)

Dividing With / ➗

The slash / divides numbers. ➗ It splits one number into equal parts!

a = 10
b = 4
print('Quotient:', a / b)

All Four at Once! 🎯

Let's do every operation on the same two numbers! Watch them all print together. 🎯

a = 12
b = 3
print('Add:', a + b)
print('Subtract:', a - b)
print('Multiply:', a * b)
print('Divide:', a / b)

Division Has Decimals 🌊

Notice that / can give a decimal answer, like 10 / 4 = 2.5! 🌊 That's normal and correct!

print(10 / 4)
print(9 / 2)
print(7 / 7)

The Order of Math 🔢

Just like in school, the computer does * and / BEFORE + and -. 🔢

Use parentheses ( ) to change the order!

print(2 + 3 * 4)
print((2 + 3) * 4)

Math With User Numbers 🗣️

Now let's combine input with math! Ask for two numbers and add them. ➕🗣️

a = int(input('First number: '))
b = int(input('Second number: '))
print('Sum is', a + b)

Show Every Answer 📋

Let's make a mini calculator that shows ALL four answers for whatever numbers you type! 📋

a = int(input('First number: '))
b = int(input('Second number: '))
print('Add:', a + b)
print('Subtract:', a - b)
print('Multiply:', a * b)
print('Divide:', a / b)

You're a Math Master! 🏆

Try different numbers below and see all the answers! 🏆 You now know the four basic operations of every calculator!

a = 20
b = 5
print('+', a + b, ' -', a - b, ' *', a * b, ' /', a / b)

Quick Check! 🧠

Test your math symbol knowledge! ✖️➗

Math Champion! 🎉

Brilliant! 🎉 You can do all four operations!

  • + adds ➕
  • - subtracts ➖
  • * multiplies ✖️
  • / divides (can give decimals) ➗

Next: letting the user CHOOSE which math to do! 🎛️

a = 8
b = 2
print('All answers:', a + b, a - b, a * b, a / b)

Frequently asked questions

Is the “Doing the Math” lesson free?

Yes — the full text of “Doing the Math” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO.

What will I learn in “Doing the Math”?

Add, subtract, multiply, divide. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Coding for Kids?

No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Doing the Math” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Coding for Kids lesson?

Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Getting Two Numbers
  2. Doing the Math
  3. Choosing an Operation
  4. Showing the Answer
← Back to Coding for Kids