Page 138 - TP_Pluse_V2.2_Class_7
P. 138
test Your skiLLs
1. Tick (ü) the correct option.
a. What will be the output of the following code:
x = 10
if x > 5:
print("x is greater than 5")
(i) x is greater than 5 (ii) 10 is greater than 5
(iii) Nothing will be printed (iv) None of these
b. What will be the output of the following code if x = 3:
if (x % 2) == 0:
print("x is even")
else:
print("x is odd")
(i) x is even (ii) x is odd
(iii) Both (i) and (ii) (iv) None of these
c. Which of the following is the result of a conditional expression?
(i) Always True (ii) Always False
(iii) Both (i) and (ii) (iv) Either True or False
d. Ravi wants to create a program in Python that assigns grades (A, B, C, and D) to the students
according to their percentage of marks. Which of the following is the best suitable option to
achieve this?
(i) The if statement (ii) The if…else statement
(iii) The if…elif…else statement (iv) None of these
2. Fill in the blanks using the words given below:
false, non-zero, top-down, conditional statements
a. ____________ are used in programming to execute different blocks of code based on certain
conditions.
b. The else part is executed only when the condition specified with if returns ____________.
c. The if…elif…else ladder follows a ____________ approach.
d. In Python, the ____________ value is interpreted as true.
3. Write 'T' for true and 'F' for false.
a. Python does not allow nested if statement. ____________
b. The if…elif…else ladder is not a conditional statement in Python. ____________
c. The if statement executes instructions if the provided condition evaluates to true. ____________
d. The if...elif...else statement allows you to test multiple conditions. ____________
136 Plus (Ver. 2.2)-VII

