Python Object-Oriented Python Advanced Objects Double

Remove pass from the body of the Double class. Define the __new__ method. The __new__ method should accept self and one

Remove pass from the body of the Double class. Define the new method. The new method should accept self and one argument. Convert the argument to an int and return it.

i am stuck

doubler.py
class Double(int):
        def __new__(self):
            self = int.__new__(self)
            return self

1 Answer

class Double(int): def __new__(*args,**kwargs): self = int.__new__(*args,**kwargs) return int(self)

now its work for me