Skip to content

Instantly share code, notes, and snippets.

@SeePetulaCode
Created January 26, 2019 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeePetulaCode/1ba73ef07d286ab50332d2105095bc68 to your computer and use it in GitHub Desktop.
Save SeePetulaCode/1ba73ef07d286ab50332d2105095bc68 to your computer and use it in GitHub Desktop.
import os
import sys
import random
import time
class Dice:
def __init__(self, sides):
self.sides = sides
def rollDice(self):
n = int(self.sides)
for i in range(1,5):
x = random.randint(1,n)
print("Dice rolled " + str(i) +"x: "+ str(x))
time.sleep(1)
print("......")
n = Dice(input("How many sides does this dice have? "))
n.rollDice()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment