If, else and elif Python

--Originally published at Ed_Alita

The core of a program is if and else because thaey give the flow to a program therefore in order to make a program you net to know how do if and else work.

 

ifex3

 

 

@SummerBreak chill flow summerbreak summer break

 

 

 

 

To put in python this is the rules to put it:

if

It has three parts the comparator and then the action this is a if context.

To do a else if comparation is the next one.

if2

The last part is the else if the compartor does not apply it goes directly to the else.

If the condition is true:

ifex1

if the cpondition is false:

Now you are a step futher in becoming a code master.

Elif

This operator is use to compare a variable to a lot of expressin if any of them is true you go to a default expression.

Put the next cod eto invoque the elif:

elif

the result is the next one:

elifex

 

The material seen here is in:

https://www.tutorialspoint.com/python/python_if_else.htm