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 does the 'not in' operator do in Python?
- A. Checks if two values are equal
- B. Checks if a value is greater than another
- C. Checks if a value is not in a sequence
- D. Checks if a value is in a sequence
Correct Answer: C
What does the 'in' operator do in Python?
- A. Checks if two values are equal
- B. Checks if a value is greater than another
- C. Checks if a value is in a sequence
- D. Checks if a value is not in a sequence
Correct Answer: C
What is the result of 'True or False' ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: A
What is the result of 'not True' ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: B
What is the result of 'True and False' ?
- A. True
- B. False
- C. None
- D. Error
Correct Answer: B
Which operator is used for exponentiation in Python?
- A. ^
- B. **
- C. ^^
- D. //
Correct Answer: B
What is the maximum possible length of an identifier?
- A. 31 characters
- B. 63 characters
- C. 79 characters
- D. none of the mentioned
Correct Answer: D
Which of the following is a valid variable name in Python?
- A. my-variable
- B. 123variable
- C. _my_variable
- D. $variable
Correct Answer: C
Which of the following is not a keyword?
- A. eval
- B. assert
- C. nonlocal
- D. pass
Correct Answer: A
What is the assignment operator in Python?
- A. ==
- B. =
- C. :=
- D. ><
Correct Answer: B