Advertisements
Advertisements
Question
Write a note on if..else structure.
Short Note
Solution
The if-else statement provides control to check the true block as well as the false block. Following is the syntax of the if-else statement.
Syntax:
if:
statements – block 1
else:
statements – block 2
shaalaa.com
Control Structure
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
How many important control structures are there in Python?
Which is the most comfortable loop?
Which amongst this is not a jump statement?
Which punctuation should be used in the blank?
if<condition>_
statement-block 1
else:
statement-block 2
List the control structures in Python.
Write a note on the break statement.
Define control structure.
Write a program to display.
A
A B
A B C
A B C D
A B C D E
Write a program to display all 3 digit odd numbers.
Write a program to display a multiplication table for a given number.