Okay, now our program is completed.
And now let's execute this once again.
And let's see.
Okay we have Python and then we have Mac changer dot pi dash I.
And it is for example eth zero okay something there is something this here I'm not going to give the
Mac address.
Let's hit enter.
Oh my god I have a big error here okay.
Let's handle this.
Let's use decision making okay.
So if someone not enter the interface or not enter the Mac address.
So we don't need to see this part okay.
We don't need to see a lot of things here.
It is better to print a readable text here that please enter the Mac address.
Or please enter the interface.
So how can we do that.
Let's come here and just imagine.
I don't know how to do it.
Let's come here and ask ChatGPT if for help.
Okay.
And here I'm going to say how to how to make a decision.
How to make a decision.
How to use decision making okay.
How to use.
Decision making in Python.
And now let's see what is it going to tell me okay.
Decision making in Python can be used if and else I think.
Wow.
It gives me a lot of examples.
It gives me a lot of thing here that that could help me to do this.
Okay.
So now I have to tell you the summary of this thing that ChatGPT gave me.
Okay, so we can make decision.
We can use decision making in Python using if condition and else condition or Elif condition.
Okay.
So as you see here, we have the get argument here that is responsible for that okay.
And for doing this.
So if I want to do that here I have to move this back okay I will ctrl x that.
And then instead of returning I need to use it here.
Right here instead of return.
So good.
And here I need to use if and else if condition to handle this okay.
So let's use if not okay.
Options dot we had Mac address okay new Mac then let's print.
Sprint, sprint or we have a parser.
We're using parser here.
So here I can use parser.
Dot error.
So it has a part that's called error.
It has a function actually.
And here I am going to give that error message here.
For example it is going to be please specify.
An interface for help or for more help or for help use dash dash help.
Okay, so it is the if part.
And also we have another option that is uh interface.
Okay.
Or here we could use interface.
And in here as you see I use Mac address.
So it is going to be interface Because that takes the messages for interface.
And here we're going to use the Lf not options dot new Mac.
Here let's print.
Do not print use parser dot error.
And here let's.
Use.
Please specify.
Please specify the new Mac address.
Or for help.
Use dash dash L.
Okay, now we have this all here.
And here is the last option.
If not, if someone provide interface and provide the Mac address.
So here we need to do other thing that is the return option.
Options.
Why not argument.
Because down here we are not going to use from argument.
We're only using options.
And here I am telling that options is equal to this.
And here we are using it.
Now save it.
Let's come here back.
And right now you see I am just providing interface and not the Mac address.
Hit enter and okay I have an error on line eight.
Okay.
Invalid syntax.
On line eight, this is the line eight.
So as you see, I have forgotten to give the assignment.
Okay.
Here.
Save it.
And let's re-execute the program.
As you see this time it is telling.
Please specify new Mac address and if I not specify the interface and dash m for example 0011.
Okay, this time it is telling me to provide the interface.
If I just provide dash I and it is eth0.
And now if I hit enter operation not permitted, no problem because I haven't used sudo.
Okay.
And you see nothing happened and means no error here.
That means it has happened successfully.
Okay, so thanks for watching and I'm so glad that you finished this part.
See you in the next section.