This is the code can somebody find the problem?
todos = []
while True:
user_action = input("Type add ,show, complete, edit or exit: ")
user_action = user_action.strip()
match user_action:
case 'add':
todo = input("Enter a todo: ") + "\n" ur backslash was a normal slash
file = open('todos.txt', 'r')
todos = file.readlines()
file.close()
todos.append(todo)
file = open('todos.txt', 'w')
file.writelines(todos)
file.close()
case 'show':
for index, item in enumerate(todos):
row = f"{index+1}-{item}"
print(row)
print(len(todos))
case 'edit':
number = int(input("Number of the todo to edit: "))
number = number - 1
new_todo = input("Enter a new todo: ")
todos[number] = new_todo
case 'complete':
number = int(input("Number of the todo to complete: "))
todos.pop(number)
case 'exit':
break
print("Bye...")