SHADAN WOMEN’S COLLEGE OF ENGINEERING AND
TECHNOLOGY
NAME :ZARA ADEEN KHADEER
BRANCH/SEC: CSE-C
HTNO.: 24L51A05I7
SUBJECT: PYTHON PROGRAMMING LAB
HANDLED BY: MS SAFIYA
EXPLANATION
• Purpose: To simulate the rolling of a 6-sided
dice.
• random.randint(1, 6) generates a random number
between 1 and 6.
• The while loop lets the user roll again as many
times as they want.
• The program stops when the user types “no”.
TOOLS AND LIBRARIES
USED
Programming Language:
1.Python – A high-level, beginner-friendly programming
language.
2. Library Used:
• random module – A built-in Python library used to
generate random numbers.
Function used: random.randint(1, 6) to
simulate a dice roll.
KEY CONCEPTS
• import random – loads Python’s random
number generator.
• while loop – repeats actions until user says
“no”.
• input() – lets the user interact with the
program.
• print() – shows the dice result.
PROGRAM
OUTPUT
THANK YOU