Advertisements
Advertisements
Question
Write a note on if..else structure.
Advertisements
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
APPEARS IN
RELATED QUESTIONS
How many important control structures are there in Python?
Elif can be considered to be the abbreviation of ______.
Which statement is generally used as a placeholder?
The condition in the if statement should be in the form of ______
What is the output of the following snippet?
i=1
while True:
if i%3 ==0:
break
print(i,end='')
i +=1
What is the output of the following snippet?
T=1
while T:
print(True)
break
Define control structure.
Write the syntax of the while loop.
Write a detail note on for loop?
Write a program to display a multiplication table for a given number.
