A conditional statement in Python is written using:
-
A
for
-
B
if
Correct answer
-
C
while
-
D
def
12 views
Explanation
if, elif, and else are used for conditional execution. The condition is followed by a colon and an indented block.
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ