CommerceVariable Names And Operators MCQs
Practice Variable Names And Operators MCQs for competitive exams.
Variable Names And Operators MCQs
Practice questions from this topic.
Which of the following is an invalid statement?
- A. abc = 1,000,000
- B. a b c = 1000 2000 3000
- C. a,b,c = 1000, 2000, 3000
- D. a_b_c = 1,000,000
Correct Answer: B
What does the != operator mean in Python?
- A. Not Found
- B. Not True
- C. Not Equal
- D. No Function
Correct Answer: C
What is the output of print("Hello" + " " + "World") ?
- A. "Hello World"
- B. "hello world"
- C. "Hello+World"
- D. "Hello" " " "World"
Correct Answer: A
Which one of these is floor division?
- A. /
- B. //
- C. %
- D. None of the mentioned
Correct Answer: B
Which operator is used to concatenate strings in Python?
- A. &
- B. +
- C. .
Correct Answer: B
Which one of the following has the highest precedence in the expression?
- A. Exponential
- B. Addition
- C. Multiplication
- D. Parentheses
Correct Answer: D
What is the result of 2 ** 3 ** 2 ?
- A. 64
- B. 512
- C. 18
- D. 81
Correct Answer: B
What is the type of the result when you add an integer and a floating-point number?
- A. Integer
- B. Floating-point
- C. String
- D. Boolean
Correct Answer: B
What is the value of x after the following code: x = 5; x += 3; ?
- A. 5
- B. 8
- C. 3
- D. 15
Correct Answer: B
What does the is operator test for?
- A. Equality of values
- B. Identity of objects
- C. Comparison of strings
- D. Inclusion in a list
Correct Answer: B
What is the result of 3 ** 2 ?
- A. 6
- B. 9
- C. 1
- D. 12
Correct Answer: B
Mathematical operations can be performed on a string.
- A. True
- B. False
Correct Answer: B