Commerce

Variable 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?

  1. A. Checks if two values are equal
  2. B. Checks if a value is greater than another
  3. C. Checks if a value is not in a sequence
  4. D. Checks if a value is in a sequence
Report Error

What does the 'in' operator do in Python?

  1. A. Checks if two values are equal
  2. B. Checks if a value is greater than another
  3. C. Checks if a value is in a sequence
  4. D. Checks if a value is not in a sequence
Report Error

What is the result of 'True or False' ?

  1. A. True
  2. B. False
  3. C. None
  4. D. Error
Report Error

What is the result of 'not True' ?

  1. A. True
  2. B. False
  3. C. None
  4. D. Error
Report Error

What is the result of 'True and False' ?

  1. A. True
  2. B. False
  3. C. None
  4. D. Error
Report Error

Which operator is used for exponentiation in Python?

  1. A. ^
  2. B. **
  3. C. ^^
  4. D. //
Report Error

What is the maximum possible length of an identifier?

  1. A. 31 characters
  2. B. 63 characters
  3. C. 79 characters
  4. D. none of the mentioned
Report Error

Which of the following is a valid variable name in Python?

  1. A. my-variable
  2. B. 123variable
  3. C. _my_variable
  4. D. $variable
Report Error

Which of the following is not a keyword?

  1. A. eval
  2. B. assert
  3. C. nonlocal
  4. D. pass
Report Error

What is the assignment operator in Python?

  1. A. ==
  2. B. =
  3. C. :=
  4. D. ><
Report Error