In this post we will learn one of the most commonly used conditional statement on all programming languages. Lets get started,
IN[1]
video_card = input("Name of the Video Card : ")
print(video_card == "GTX 1050")
if video_card == "GTX 1050" :
print("It can run GTA 5 in High Settings")
elif video_card == "GTX 1060" :
print("It can run GTA 5 in Ultra Settings")
else :
print("Card not Listed")
print("Its outside If statement")
OUT[1]

We have seen Boolean in our previous post. Boolean will only return either True or False, but if you wish to perform certain operation IF this condition is either True or False then we have to use conditional statement.
You can declare a IF, following below syntax
if condition or expression :
Statement
elif condition or expression :
Statement
else :
Statement
If you notice there is a tab space before the statement this is to let interpreter know that it was a part of that IF condition. The order of execution is on the following priority, IF --> ELIF --> ELSE. When condition passes, following statements is executed and comes out of the block.
In our example, we take input from users. If the input from user is GTX 1050 then only this statement "It can run GTA 5 in High Settings" will be printed. Likewise if input is GTX 1060 then It can run GTA 5 in Ultra Settings is printed. If user input is other than GTX 1050 and GTX 1060 then Card not Listed will be printed.
In IF conditional statement both ELIF and ELSE are optional, and a IF condition can have more than one ELIF.