Chapter 3 Brief Overview of Python — Online MCQ Test
INFORMATICS PRACTICES · Grade 11 · CBSE(NCERT)
Practice Chapter 3 Brief Overview of Python with a free chapter-wise online MCQ test.
This chapter covers: Introduces Python programming fundamentals. Covers Python syntax keywords variables data types operators expressions input and output functions conditional statements loops and bas....
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter 3 Brief Overview of Python — Important Questions & Answers
Which of the following is a valid Python variable name?
- A. 2score
- B. score_2
- C. score-2
- D. score 2
Answer: B. score_2
A Python variable name can contain letters, digits, and underscores, but it cannot start with a digit or contain spaces/hyphens.
A Python variable name can contain letters, digits, and underscores, but it cannot start with a digit or contain spaces/hyphens.
Which of the following is a keyword in Python?
- A. print
- B. value
- C. if
- D. total
Answer: C. if
"if" is a reserved keyword used for conditional execution. The other options are identifiers or built-in function names, not keywords.
"if" is a reserved keyword used for conditional execution. The other options are identifiers or built-in function names, not keywords.
What is the output of: print(5 + 2 * 3) ?
- A. 21
- B. 11
- C. 15
- D. 17
Answer: B. 11
Multiplication is done before addition, so 2 * 3 = 6 and then 5 + 6 = 11.
Multiplication is done before addition, so 2 * 3 = 6 and then 5 + 6 = 11.
Which data type is returned by the expression 10 / 2 in Python 3?
- A. int
- B. float
- C. str
- D. bool
Answer: B. float
In Python 3, the division operator / always returns a float, even if the result is a whole number.
In Python 3, the division operator / always returns a float, even if the result is a whole number.
Which of the following is the correct way to assign 15 to variable x?
- A. 15 = x
- B. x == 15
- C. x = 15
- D. x := 15
Answer: C. x = 15
The assignment operator = is used to store a value in a variable.
The assignment operator = is used to store a value in a variable.
What will be the output of: print(type("11")) ?
- A. <class 'int'>
- B. <class 'float'>
- C. <class 'str'>
- D. <class 'bool'>
Answer: C. <class 'str'>
Anything written inside quotes is a string, so type("11") returns str.
Anything written inside quotes is a string, so type("11") returns str.
Which of the following is the correct order of operators precedence in: 4 + 6 * 2 ** 3 ?
- A. Addition, multiplication, exponentiation
- B. Exponentiation, multiplication, addition
- C. Multiplication, exponentiation, addition
- D. Addition, exponentiation, multiplication
Answer: B. Exponentiation, multiplication, addition
Python evaluates exponentiation first, then multiplication, and finally addition.
Python evaluates exponentiation first, then multiplication, and finally addition.
What will be the output of: print(bool(0), bool(5), bool(""), bool("IP")) ?
- A. True False True False
- B. False True False True
- C. False False False True
- D. True True False False
Answer: B. False True False True
In Python, 0 and empty strings are False, while non-zero numbers and non-empty strings are True.
In Python, 0 and empty strings are False, while non-zero numbers and non-empty strings are True.
Which of the following expressions will cause an error in Python?
- A. "10" + "20"
- B. 10 + 20
- C. "10" + 20
- D. 10 * 2
Answer: C. "10" + 20
Python cannot directly add a string and an integer. Both operands must be of compatible types.
Python cannot directly add a string and an integer. Both operands must be of compatible types.
Consider the code: x = 5 if x > 3: if x < 10: print("Yes") What will be printed?
- A. Yes
- B. No
- C. Nothing
- D. Error
Answer: A. Yes
Both conditions are true, so the nested if statement executes the print statement.
Both conditions are true, so the nested if statement executes the print statement.