My Channel

Python Coding Series:Episode 4: If else statement | Introduction to If else statement?

 Python Coding series

If else statement

Hi guys,

       Welcome back to the Python coding series.

Today we will see about the if-else statement which is very useful in Python.

The if-else statement, as its name says if we give a specific value, a particular value will be outputted and if other than that something is entered, a specific output will give us give 'else'. When we want two or more outputs to be shown for two or more specific outputs, we give the 'elif' statement.



An instance of the if-else - elif statement code:

A = input("Enter Yes/No")

if A == 'Yes':

     print("Acceptable")

elif A == 'yes':

     print("Acceptable")

else:

     print("Not Acceptable")

Meet you on the Next Blog

Until then Bye!

By the Blog Author.


Post a Comment

0 Comments