class Bin:
def __init__(self, digit):
"""init the digit value and create list"""
if digit < 0 or digit > 9:
raise ValueError("digit must be >= 0 and <=9")
if not isinstance(digit, int):
raise ValueError("digit must be an integer")
self.digit = abs(digit)
self.list = []
def get_bin(self):
"""return the bin as a list"""
return self.list
def get_digit(self):
"""return the digit value of the object"""
return self.digit
def insert(self, new):
"""insert element in the 0th position"""
self.list.append(new)
def clear(self):
"""clear the list"""
self.list.clear()