Why am I getting these errors: Console: "TypeError: printTodos() missing 1 required positional argument: 'self'"
Squiggly underline in VS code under "TodoList" on the last 2 lines with the error "No value for argument 'self' in unbound method callpylint(no-value-for-parameter)"
class TodoList:
def __init__(self, todos):
self.todos = todos
self.count = 1
self.indent_width = " "
def add_todo(self):
response = input("Please input a todo: \n")
self.todos.append(self.indent_width + response)
def printTodos(self):
for todo in self.todos:
print(self.indent_width + str(self.count) + "." + todo)
self.count += 1
todo_list = TodoList(["Have fun", "Chill"])
while (True):
TodoList.add_todo()
TodoList.printTodos()
Thanks for any advice!