i need help in a python program, i was creating a program in which there is a class and creating an object from it should become a list, i posted this question on another forum too tho i did not get lot of help. This is example code of what i want to achieve:
class Myclass(list): def __init__(self,val1,val2,val3): self.val1=val1 self.val2=val2 self.val3=val3 Myclass.append(val1) Myclass.append(val2) Myclass.append(val3)
this results an error when i create a variable using this class which i have no idea how to solve, and when i try to call the variable after encountering the error then the variable is not defined and i get NameError
so can anyone tell how to create list object from this class and then even edit it??