Then here I’m using this underscore pattern and then after it I am giving a value to it 34 and I will.
Be parsing it then after it simply I will.
Be writing my F conditions so here I am writing F let’s um and then.
Here I’m checking if my some color is equal to my favorite color and inside it I will be printing using.
Your favorite color and then printing the value and Here I am writing as background color and now in miles flock I’m checking if it’s Tuesday then I.
Will be printing Tuesday is gree and after it I will be using another Elsa flit so here I’m writing else if and then let and here I’m just riding okay than H nought equals to H and then inside it I’m checking if my age is glued identity and then simply am printing using purple as the background color.
As if it’s not true then I will be printing using oranges background color and in my last tells I will be just riding Flint Ellen then Here I am riding using blue as the background color so now here in this program we have mixed f-flat elsif and elsa flat and else also so this conditional structure let us.
Support complex requirements with the hard-coded values we have there this example will print using purple as the background color if I compile it now so I will be compiling it our program is compiled and it’s working and our answer is using purple as the background color so how our program is working so first I have just encoded my nun in my favorite color so this condition will.
Be going to fail because it will begin to check if.
There is something in my option inna but in my option enum I have none so after it it will check if it’s Tuesday but here I specified false so in that condition I have used a flat and here I’ve written okay a is equals to H and then here what I’ve done simply I’ve.
Checked whether my age is greater than 30 so if my age is greater than 30 I will be printing using purple as.
The background color and my age is 34 as you.
Can see and so this else condition will not begin to execute and now if I just put any value here suppose Here I am writing some red now let’s try to.
Compile our program again it’s compiled and this time our output is using your favorite color red as the background so here we have specified some value so this condition will be going to match so in this program you can notice that here I have used the shadowing so you can use a flag that can also shadow variables in the same way that match arm scan the line if let okay h equals to h introduces a new shadowed variable that.
Is h that contains the value inside the okay variant this means we need to place if.
H greater than 30 condition within that block so that outside of.
Using a flat expression is that compiler doesn’t check exhaustive nests whereas with math expression it does if we omitted the last else block and therefore mist handling some cases the compiler would not alert us.
To the possible logic bug so now that’s it for this video midi soon goodbye you.