- Conditional statement - The if keyword is used to check a condition.
- If statement - If the condition is true then the block of code inside the id statement is executed.
if condition :
____statement
# INDENTATION - It is a white space character used at beginning of line.
- If-elif - It is a keyword that allows to check multiple conditions. It comes after an if & is used if the 'if' statement isn't executed or the condition is false.
- It can be of multiple times after if is made.
#* In this no conditions are required only statements are printed.
- Loop - These are used to execute a block of code repeatedly based on certain conditions.
These are of two types -
1. For loop.
2. While loop.
1-> wHILE- loop executes a block of code as long as the given condition is true. It checks the condition before each iteration and if it evaluates to false, the loop terminates.
2-> FOR-
Comments
Post a Comment