0Pricing
Coding for Kids · Lesson

Rolling Two Dice

Add the dice.

Rolling Two Dice 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.

Two Dice! 🎲🎲

Many games use TWO dice. Roll them both and add the numbers for your score! ➕

Roll the First Die 🎲

Roll one die and save it.

import random
die1 = random.randint(1, 6)
print('Die 1:', die1)

Roll the Second Die 🎲

Now roll a second die into its own box.

import random
die2 = random.randint(1, 6)
print('Die 2:', die2)

Roll Both Together 🎲🎲

Roll both dice in one program!

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
print('You rolled', die1, 'and', die2)

Add Them Up ➕

The total is both dice added together!

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
total = die1 + die2
print('Total:', total)

Show the Whole Roll 🎯

Display both dice AND the total in one message!

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
print('🎲', die1, '+ 🎲', die2, '=', die1 + die2)

Snake Eyes! 🐍

Two ones is called snake eyes! Let's check for it.

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
if die1 == 1 and die2 == 1:
    print('Snake eyes! 🐍')
else:
    print('Total:', die1 + die2)

Doubles! 👯

When both dice match, that's doubles — often a bonus in games!

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
if die1 == die2:
    print('Doubles! 👯')
else:
    print('No doubles')

Lucky Seven 🍀

A total of 7 is lucky in many dice games!

import random
total = random.randint(1, 6) + random.randint(1, 6)
if total == 7:
    print('Lucky 7! 🍀')
else:
    print('You got', total)

Roll Both Many Times 🔂

Use a loop to roll two dice over and over!

import random
for i in range(3):
    total = random.randint(1, 6) + random.randint(1, 6)
    print('Roll', i + 1, 'total:', total)

Make a Roll Tool 🛠️

A function can roll two dice and give the total!

import random
def roll_two():
    return random.randint(1, 6) + random.randint(1, 6)
print('Total:', roll_two())

Quick Check ✅

How do you get the total of two dice?

Double Roller! 🏆

Great rolling! You learned to:

  • Roll two dice 🎲🎲
  • Add them for a total ➕
  • Check for doubles and snake eyes 👯🐍
  • Make a roll function 🛠️

Next: track points over many rolls! 📊

Frequently asked questions

Is the “Rolling Two Dice” lesson free?

Yes — the full text of “Rolling Two Dice” 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 “Rolling Two Dice”?

Add the dice. 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 “Rolling Two Dice” 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. Rolling One Die
  2. Rolling Two Dice
  3. Tracking Dice Points
  4. First to Twenty
← Back to Coding for Kids