I have this code
class NewList(DQ):
def __init__(self, initial_state):
self.data = initial_state
def append(self, element):
new_item = [element]
self.data = self.data + new_item
my_list = NewList([1, 2, 3, 4, 5])
print(my_list.data)
my_list.append(6)
print(my_list.data)
But Dataquest says:
my_list isn’t defined in your code, but we expected it to be NewList type
I don’t see any error.
Please help
Thank you!.