CBSE Class 10 Computer Applications Question 10 of 26

Python Conditionals and Loops — Question 1

Back to all questions
1
Question

Question 1

What are selection statements ? How are they useful ?

Answer

A statement that carries out a set of instructions depending upon a condition's result is known as a selection or conditional statement. Python provides selection statements in the form of if and if-else statements.

These statements enable a program to carry out a set of instructions depending upon a condition's result. For example,

num = 5
if num >= 0 :
    print "Positive"
else :
    print "Negative"