Reputation: 1
class Dice:
def __init__(self, sides = 6, value= None):
self.sides = sides
self.value = value
def roll(self):
self.value = randint(1, self.sides)
return self.value
class greenDie(Dice):
def __init__(self, sides, value):
super().__init__(self, sides, value)
super().__str__(self,value,faces)
faces = {1: "🧠", 2: "🧠", 3: "🧠",
4:"👣", 5:"👣", 6:"💥"}
Later call
I keep on getting the error "init() missing 1 required positional argument: 'value'" no matter what changes I have made. I have looked at similar problems and tried to use their methods to fix my own, but they never work.
Upvotes: 0
Views: 176
Reputation: 9590
You don't need to explicit pass self
while calling the class methods.
It should be:
super().__init__(sides, value)
Upvotes: 1