PYTHON If Statement MCQPython MCQ
- If Statement
- Multiple Choice Question
(1) Which of the following will invert the result of relational expression?
NOT operator will return FALSE if given condition is TRUE, and return TRUE is given condition is FALSE.
(2) If both conditions are TRUE then it will return TRUE.
AND operator will return true only if all the provided results are true.
(3) which operator is used with multiple conditions in if statement?
In python logical operators are used to combine results of multiple relational expressions.
(4) How many conditions can be used with single if statement?
We can use multiple relational expressions / conditions with single if statement.
(5) In python programming if statements are written after ________ tabs.
Statements that will execute when condition is TRUE are placed after one tab.
(6) Statement or set of statements are executed only if provided relational expression is.
Only statements are executed when result of condition is true.
(7) In python which of the following operator is used after condition of if statement?
A) Semicolon (;)
B) Comma (,)
C) Colon (:)
D) Dot (.)
Colon is the operator that is used after relational expression or condition of if statement.
(8) In python which of the following keyword is used to implement selection structure?
if is a python keyword, which is used to implement simple selection structure.