Yesterday.
We completely changed the way our users interact with the program.
So now we allow the user to enter A to do here on the fly and fix the bug, for example.
You press that and it is added to the to do items.
Now to be able to do that, we had to change from match case to if Elif else.
So now we check for expressions.
So if ads is in the user action string user action is what we get from the user.
So they enter ads followed by the to do and so on.
So we check if the part ad is in that.
User input.
And then we extract the to do from the user action and we use list slicing for that.
So we only get the characters that come after add so for and everything after for.
And then we read the file to get the existing to dos.
We append the new to do to the to do list and we write the update to this list.
So then we have a live.
So what happens is that if the user entered ad, this block will be executed and these other blocks
will not be executed at all, which makes the code efficient.
But if the user entered something else, the program will check If AD is in user action, it will not
execute this, but then it will check the next l if condition so l if show then it executes this.
We didn't change anything from the showcase.
If the user enters.
Edit.
Again, we extract the part after edits using list slicing, and then we added the existing to the item
as we did before.
The same goes for complete.
We use list slicing.
We get everything after the ninth character.
And so one other wise, we have this else case here, which is the case where the user didn't answer
any of these commands.
So they didn't enter ad they didn't enter, show, not edit, not complete, not exit, but something
else.
In that case we say, Oh, your command is valid, it's not valid.
So that's what we did yesterday.
Today we're going to improve the program even further and learn new Python features.
So I'll talk to you in the next video.