Files
lab_dice/die.py
tsmith37 4ff8ebc6a3 Finished checkpoint 1
I could simulating a classroom reward system where students earn points for positive behaviors.
2025-11-18 16:27:43 -05:00

19 lines
284 B
Python

# die.py
# ------
# By MWC Contributors
# Implments a Die class.
from random import randint
class Die:
def __init__(self):
self.roll()
def __str__(self):
return str(self.face)
def roll(self):
self.face = randint(1, 6)
return self.face