Welcome back.
We created load tasks.
Function.
Save tasks function.
Add task function.
View tasks function.
And now let's test our application.
So here running and testing our program.
First of all print.
Welcome to our to do list tasks equals to load tasks.
Here we are calling the function load tasks and save it inside a variable called tasks or current tasks.
Okay this is simple.
Now we need to loop through the tasks and see if we need to add the task, view, task or exit.
So we are going to allow the user to choice to choose between um between adding task, viewing task
or exit.
So the backslash which is a new line refers to new line add task number two.
View tasks number three.
Exit.
Then we need to store it inside the choice.
Choice equals to input.
Choose an option for this.
We are listening and waiting for the choice of the user.
Here we need to use the if and else conditions.
If choice equals to one, then what we need to do, we need to call add task and pass the current tasks.
Also, we need to call the function save tasks and pass the current task.
Thanks for the AI that generates and suggests some codes now.
Elif choice equals to two.
What we need to do.
We need to view tasks.
So here call the function view tasks.
It's very simple.
Pass the current task Also another choice is three for exit.
Say goodbye and break because we don't need to loop anymore.
Then here we need to print invalid choice if we if the user selects four for example.
So here we have three options one for adding task, two for viewing tasks, three for ex.
Let me run the cell.
And here we have the output.
Welcome to our to do list.
Add task view tasks and exit.
If we open this folder we have this text file.
We can delete it.
Delete file click okay.
And here we don't have any files.
Let me add that task.
So number one enter.
Enter a task please.
For example by GPU 4060 for example Nvidia.
Okay.
Now let me open the folder.
You can see tasks dot txt file is created.
Open it and here we go by GPU 4060 Nvidia.
Okay.
This is the first line.
Also the, the uh, if you if you notice that the program is looping and waiting for an option.
So every the application will keep looping because I included inside a while loop.
Okay.
So this is an infinite loop until the user enters choice three which is exit okay.
So if the user enters six we have an invalid choice.
Try again.
We have to add task view tasks and exit.
Let me add another choice by hyper X microphone enter.
And here we go.
Now open tasks and here we go that tasks dot txt being updated.
Now let me view the tasks.
So enter number two enter.
And here we go your tasks by GPU, Nvidia and by HyperX, and the application keeps running because
we have an infinite loop.
In order to break out of this cell and out of this application, we need to exit.
So three here we go.
The application is ended.
Okay.
So you see.
Goodbye.
This is our lovely application.
This is a very important application that reviews the file input output, how to write and how to save
data to a file.
How to read from a file in Python, how to use conditional statements, how to use while loop and others.
Okay, so this is a very important application that reviews all the previous concepts in Python.
Okay.
So we're going to use file input output as much in much in the next videos and next section.