How to Use the Random Module to Simulate Dice Rolling

import random

def roll_dice():
    return random.randint(1, 6)

dice_roll_result = roll_dice()
print(f"The result of rolling a dice: {dice_roll_result}")

Output:

The result of rolling a dice: 3

Leave a Comment

Your email address will not be published.