• Test have total 20 questions.
  • Test time is 20 minutes.

Top 20 python MCQ questions and answer

Q 1.
What is the maximum possible length of an identifier?

Q 2.
Given a function that does not return any value, What value is thrown by default when executed in shell.

Q 3.
In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.
>>>x = 13 ? 2

objective is to make sure x has a integer value, select all that apply (python 3.xx)

Q 4.
What is the value of the following expression?
8/4/2, 8/(4/2)

Q 5.
What are the values of the following Python expressions?

Q 6.
Given a string example=”hello” what is the output of example.count(‘l’)?

Q 7.
The function pow(x,y,z) is evaluated as:

Q 8.
Program code making use of a given module is called a __________ of the module.

Q 9.
Which function overloads the + operator?

Q 10.
Which operator is overloaded by __invert__()?

Q 11.
Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?

Q 12.
Which of the following is not a keyword in Python?

Q 13.
Select the reserved Keywords

Q 14.
Which of the following is a correct statement with respect to round()?

Q 15.
Which of these is not a core data type in python?

Q 16.
All the keywords in python is written in

Q 17.
Point out the invalid variable

Q 18.
Is tuple mutable?

Q 19.
Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?

Q 20.
Which command is used to add an element in the list?