I create a task management system that allows a user to add new tasks, view all tasks, view incomplete tasks, view completed tasks, update tasks, and mark tasks as complete.
This code defines a class called Task that represents a single task in a task management system. The Task class has several methods that allow the user to perform different actions on tasks, such as adding new tasks, viewing all tasks, viewing incomplete tasks, viewing completed tasks, updating tasks, and marking tasks as complete.
The init method is the constructor of the Task class, and it is called every time a new Task object is created. This method initializes the task's attributes, such as task, created_time, and task_done, and stores the new task in a dictionary called tasks.
The update_task method updates the task's name, and the complete_task method marks the task as completed. The str method returns a string representation of the task that includes its ID, name, and other attributes.