from random import randint
class Die ():
def _init_(self,num_sides=6):
self.num_sides=num_sides
def roll(self):
return randint(1,self.num_sides)
die=Die ()
results= []
for roll_num in range (1100):
result=die.roll()
results.append(result)
print (results)
error report:
raceback (most recent call last):
File "D:/python_work/die_visual.py", line 11, in < module >
result=die.roll()
File "D:/python_work/die_visual.py", line 6, in roll
return randint(1,self.num_sides)
AttributeError: "Die" object has no attribute" num_sides"
Process finished with exit code 1