Python program for Dice simulator - Tipszon

Python program for dice simulation
import random
print("This is a dice stimulator")
x = "y"
while x == "y": number = random.randint(1,6)
if number == 1:
print("----------")
print("| |")
print("| O |")
print("| |")
print("----------")
if number == 2:
print("----------")
print("| |")
print("| O O |")
print("| |")
print("----------")
if number == 3:
print("----------")
print("| O |")
print("| O |")
print("| O |")
print("----------")
if number == 4:
print("----------")
print("| O O |")
print("| |")
print("| O O |")
print("----------")
if number == 5:
print("----------")
print("| O O |")
print("| O |")
print("| O O |")
print("----------")
if number == 6:
print("----------")
print("| O O |")
print("| O O |")
print("| O O |")
print("----------")
x = input("Press y to roll again")


Post a Comment

0 Comments