Skip to content

Commit

Permalink
Create dice3.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PrachiKhatri22 authored Oct 13, 2021
1 parent 3958760 commit 3ad63f0
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions dice3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import random


x = "y"

while x == "y":

# Gnenerates a random number
# between 1 and 6 (including
# both 1 and 6)
no = random.randint(1,6)

if no == 1:
print("[-----]")
print("[ ]")
print("[ 0 ]")
print("[ ]")
print("[-----]")
if no == 2:
print("[-----]")
print("[ 0 ]")
print("[ ]")
print("[ 0 ]")
print("[-----]")
if no == 3:
print("[-----]")
print("[ ]")
print("[0 0 0]")
print("[ ]")
print("[-----]")
if no == 4:
print("[-----]")
print("[0 0]")
print("[ ]")
print("[0 0]")
print("[-----]")
if no == 5:
print("[-----]")
print("[0 0]")
print("[ 0 ]")
print("[0 0]")
print("[-----]")
if no == 6:
print("[-----]")
print("[0 0 0]")
print("[ ]")
print("[0 0 0]")
print("[-----]")

x=input("press y to roll again and n to exit:")
print("\n")

0 comments on commit 3ad63f0

Please sign in to comment.