WEBVTT

00:00.160 --> 00:01.200
Welcome back.

00:01.360 --> 00:03.280
We created load tasks.

00:03.280 --> 00:04.200
Function.

00:04.240 --> 00:06.400
Save tasks function.

00:06.400 --> 00:08.280
Add task function.

00:08.440 --> 00:10.360
View tasks function.

00:10.360 --> 00:13.280
And now let's test our application.

00:13.280 --> 00:17.520
So here running and testing our program.

00:17.560 --> 00:19.160
First of all print.

00:19.200 --> 00:24.600
Welcome to our to do list tasks equals to load tasks.

00:24.840 --> 00:35.080
Here we are calling the function load tasks and save it inside a variable called tasks or current tasks.

00:35.120 --> 00:36.720
Okay this is simple.

00:36.760 --> 00:47.280
Now we need to loop through the tasks and see if we need to add the task, view, task or exit.

00:47.280 --> 00:57.280
So we are going to allow the user to choice to choose between um between adding task, viewing task

00:57.280 --> 00:58.400
or exit.

00:58.400 --> 01:07.320
So the backslash which is a new line refers to new line add task number two.

01:07.520 --> 01:10.560
View tasks number three.

01:10.600 --> 01:11.320
Exit.

01:11.320 --> 01:14.680
Then we need to store it inside the choice.

01:14.800 --> 01:16.920
Choice equals to input.

01:16.960 --> 01:19.520
Choose an option for this.

01:19.560 --> 01:24.280
We are listening and waiting for the choice of the user.

01:24.320 --> 01:29.560
Here we need to use the if and else conditions.

01:29.560 --> 01:42.680
If choice equals to one, then what we need to do, we need to call add task and pass the current tasks.

01:42.720 --> 01:48.600
Also, we need to call the function save tasks and pass the current task.

01:48.760 --> 01:54.840
Thanks for the AI that generates and suggests some codes now.

01:55.080 --> 01:59.120
Elif choice equals to two.

01:59.360 --> 02:00.520
What we need to do.

02:00.680 --> 02:02.840
We need to view tasks.

02:02.840 --> 02:06.760
So here call the function view tasks.

02:06.800 --> 02:07.960
It's very simple.

02:08.000 --> 02:14.390
Pass the current task Also another choice is three for exit.

02:14.430 --> 02:19.630
Say goodbye and break because we don't need to loop anymore.

02:19.790 --> 02:27.270
Then here we need to print invalid choice if we if the user selects four for example.

02:27.270 --> 02:34.950
So here we have three options one for adding task, two for viewing tasks, three for ex.

02:35.030 --> 02:37.310
Let me run the cell.

02:37.310 --> 02:39.310
And here we have the output.

02:39.310 --> 02:41.430
Welcome to our to do list.

02:41.470 --> 02:44.510
Add task view tasks and exit.

02:44.750 --> 02:47.310
If we open this folder we have this text file.

02:47.310 --> 02:48.470
We can delete it.

02:48.470 --> 02:50.350
Delete file click okay.

02:50.350 --> 02:52.830
And here we don't have any files.

02:52.870 --> 02:55.270
Let me add that task.

02:55.270 --> 02:57.590
So number one enter.

02:57.790 --> 02:59.710
Enter a task please.

02:59.710 --> 03:05.990
For example by GPU 4060 for example Nvidia.

03:06.030 --> 03:06.550
Okay.

03:06.590 --> 03:08.830
Now let me open the folder.

03:08.830 --> 03:12.750
You can see tasks dot txt file is created.

03:12.790 --> 03:18.550
Open it and here we go by GPU 4060 Nvidia.

03:18.710 --> 03:19.150
Okay.

03:19.190 --> 03:20.550
This is the first line.

03:20.550 --> 03:29.710
Also the, the uh, if you if you notice that the program is looping and waiting for an option.

03:29.710 --> 03:37.350
So every the application will keep looping because I included inside a while loop.

03:37.630 --> 03:38.070
Okay.

03:38.110 --> 03:46.990
So this is an infinite loop until the user enters choice three which is exit okay.

03:47.270 --> 03:52.270
So if the user enters six we have an invalid choice.

03:52.390 --> 03:53.270
Try again.

03:53.590 --> 03:57.670
We have to add task view tasks and exit.

03:57.830 --> 04:04.350
Let me add another choice by hyper X microphone enter.

04:04.350 --> 04:05.190
And here we go.

04:05.270 --> 04:11.150
Now open tasks and here we go that tasks dot txt being updated.

04:11.190 --> 04:13.830
Now let me view the tasks.

04:13.830 --> 04:16.150
So enter number two enter.

04:16.310 --> 04:26.620
And here we go your tasks by GPU, Nvidia and by HyperX, and the application keeps running because

04:26.620 --> 04:28.060
we have an infinite loop.

04:28.300 --> 04:35.020
In order to break out of this cell and out of this application, we need to exit.

04:35.020 --> 04:36.860
So three here we go.

04:37.100 --> 04:39.580
The application is ended.

04:39.820 --> 04:40.380
Okay.

04:40.420 --> 04:41.140
So you see.

04:41.180 --> 04:41.740
Goodbye.

04:41.900 --> 04:44.540
This is our lovely application.

04:44.540 --> 04:53.780
This is a very important application that reviews the file input output, how to write and how to save

04:53.780 --> 04:55.100
data to a file.

04:55.140 --> 05:05.660
How to read from a file in Python, how to use conditional statements, how to use while loop and others.

05:05.860 --> 05:14.740
Okay, so this is a very important application that reviews all the previous concepts in Python.

05:14.740 --> 05:15.260
Okay.

05:15.540 --> 05:24.100
So we're going to use file input output as much in much in the next videos and next section.
