 # Simple Dice Game Using Python

In this tutorial we will make a simple dice game using python. So, let’s get started.

To make this game we need one module:

• random

We need to use a random module to generate numbers between 1 to 6 each time. to get more info about the random module, you can check its documentation.

We start by importing the randint method or function from a random module. then we used while loop to continuously run our code (based on user input roll). we run our loop again and again when the input is “y”.

``````from random import randint

roll = "y"
while roll == "y":
print("Rolling the dices...")
dice1 = randint(1,6)
dice2 = randint(1,6)
print(dice1, dice2)

roll = input("Roll Again?")``````

This is the recent 3 outputs.

Related post: How to Make a Simple Calculator Using Python

Still wondering how to get started with python?

Check out our exclusive book,

##### You May Also Like ## Number Guessing Game Using Python

In this tutorial I’ll show you how to make a simple number guessing game using python. Again we will use random module to generate random number. To make this game… ## How to Encrypt and Decrypt Data Using Python

Data Encryption is the process through which data is encoded so that it remains hidden from or inaccessible to unauthorized users. In this tutorial, I’ll show you how to How to Encrypt and… ## How to Make a Simple Calculator Using Python

In this tutorial, I’ll show you how to make a simple calculator using python. Let’s make a simple calculator using python. this will be a simple python script, not GUI.… ## Rock Paper Scissors Game Using Python

In this tutorial I’ll show you how to make a simple rock paper scissors game using python. Here we need one module: random We need to use a random module… ## How to Get Wikipedia Results Using Python (GUI)

In this tutorial I’ll show you how to get Wikipedia results using python. This will be a GUI. To get results from wikipedia using python we need to use one…