Conditional Statement Lab Giude
Conditional Statement Lab Giude
Step 2: Open the file in editor of your choice (VS Code, notepad++, or notepad)
The if statement
if expression:
statement
Output:
Output:
if condition:
#block of statements
else:
#another block of statements (else-block)
Output:
Example 2: Program to check whether a number is even or not.
Output:
if expression 1:
# block of statements
elif expression 2:
# block of statements
elif expression 3:
# block of statements
else:
# block of statements
Output:
Output: