Any expression which returns either true or false that expression is known as condition.

Python Conditional Statements :

The Python Conditional statements are used to decide whether the code has to be execute or skip based on evaluation of the expression.

Elements of Conditional Statements :

While working with conditional statements we use two elements :

  1. Condition
  2. Block

Condition : Any expression which returns either true or false that expression is known as Condition.

Block : All the statements which are falling under the same space indentation is known as Block.

  • Blocks begins with when the indentation increases.
  • Blocks can contain multiple blocks.
  • Blocks ends when indentation decreases to zero or to a containing blocks indentation.

Typically Python supports three conditional statements, there are :

  1. if (or) simple if
  2. if else
  3. elif

Happy Learning 🙂

About the Author:

Founder of onlinetutorialspoint.com Love Java, Python, Shell and opensource frameworks. Follow him on twitter and facebook for latest updates.

Leave A Comment