Beginner Codes/Python/Dice Roller Program
38%

Instructions

Syntax

die1 = random.randint(1, 6) total = die1 + die2

Dice Roller Program 🎲

Namba Ludo, Snake & Ladders vilayadum podhu dice roll pannuvom la? Adhey madhiri oru program-a Python-la eppadi pandradhu nu paapom!

Rolling a Die 🎲

Oru normal dice-la 1 to 6 varaikum numbers irukkum. So, adhukku random.randint(1, 6) use panna podhum.

import random

die1 = random.randint(1, 6)
die2 = random.randint(1, 6)

total = die1 + die2
print(total)

Idhula 2 dice-oda number-a eduthu, total variable-la add panni print panrom.

Roll the Dice! 🎰

Kizhe ulla game-la Roll Dice button-a click panni random numbers eppadi generate aagudhu nu paarunga!

Dice Roller Logic

import random
die1 = random.randint(1, 6)
die2 = random.randint(1, 6)
total = die1 + die2
print(total)
die1
...
die2
...
total
...
Click Roll Dice to generate two random numbers!

Your Turn! (Unga neram!)

Code-la die1 and die2 generate panna aachu. Neenga andha rendu number-a add panni total la save panni print pannunga!

Help

Dice Roller ProgramExercise 30/7735 XP
❴❵ script.py
python.code
python
Loading...
Terminal
Terminal — python
Beginner Codes Terminal v1.0.0
─────────────────────────────────────
Ready. Click "Run Code" to execute...
Ready
Piston APIPYTHON0 lines