CommerceVariable Names And Operators MCQs
Practice Variable Names And Operators MCQs for competitive exams.
Variable Names And Operators MCQs
Practice questions from this topic.
What is the result of round(3.75) ?
- A. 3
- B. 3.75
- C. 4
- D. 3.5
Correct Answer: C
What is the purpose of the modulo operator (%) in Python?
- A. Finding the exponent
- B. Multiplying numbers
- C. Calculating the square root
- D. Calculating the remainder
Correct Answer: D
What is the result of 10 / 2 ?
- A. 5.0
- B. 5
- C. 2
- D. 0.5
Correct Answer: A
The expression Int(x) implies that the variable x is converted to integer.
- A. True
- B. False
Correct Answer: A
What is the order of precedence for the arithmetic operators in Python?
- A. +, *, /, -
- B. /, *, +, -
- C. *, /, +, -
- D. +, -, *, /
Correct Answer: C
What is the result of the expression 7 % 3 ?
- A. 2.33
- B. 2
- C. 0.333
- D. 1
Correct Answer: D
What is the result of len("python") ?
- A. 6
- B. 5
- C. 7
- D. "python"
Correct Answer: A
What is the answer to this expression, 22 % 3 is?
- A. 7
- B. 1
- C. 0
- D. 5
Correct Answer: B
Operators with the same precedence are evaluated in which manner?
- A. Left to Right
- B. Right to Left
- C. Can't say
- D. None of the mentioned
Correct Answer: A
Which is the correct operator for power(xy)?
- A. X^y
- B. X**y
- C. X^^y
- D. None of the mentioned
Correct Answer: B
What does the '//' operator do when used with negative numbers?
- A. Returns the positive quotient
- B. Returns the negative quotient
- C. Rounds down to the nearest integer
- D. Rounds up to the nearest integer
Correct Answer: C
What is the result of "Hello" in "Hello, World!" ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: A