My First Project
Hi Guys, I’m new to coding, i done the java course first and then the python. Python took my interest, i done the tutorial along with help online and from the great comments section. I got through it with a fairly decent understanding in about 2 days. I looked online for good projects for (python)beginners. Number 1 was a rolling dice gen. here is my attempt but i’m having some teething snags. Any comments, good or bad will be appreciated but i want it to work. Thanks >>> """ Dice Rolling Sim""" import random print ("Welcome to the Dice Rolling sim!") class RollTheDice(): def __init__(self): self.min = 1 self.max = 6 super(RollTheDice, self). __init__() def ask_something(self): while True: userinput = input("Roll Again? Yes or No?" + "\n") if (userinput == 'yes'): self.rollDice() else: print("You Didn't type 'Yes'. No roll, Goodbye!.") exit() def rollDice(self): print("rolling the dice!") print("The values are...") print (random.randint(self.min, self.max)) return RollTheDice = rollDice() RollTheDice.ask_something() >>>