Created
January 26, 2019 03:31
-
-
Save SeePetulaCode/1ba73ef07d286ab50332d2105095bc68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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