Python Programming Quiz


Play this Python quiz that will help you to excel in C++ certification exams, placements etc. This Python programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Python programming test enables you to assess your knowledge of Python programming.

Take the Free Practice Test



Python MCQs

Practice Python MCQ Questions, which will help you to understand Python programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

Python Quiz

Try Free Python Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Python Quiz

1. Suppose B is a subclass of A, to invoke the __init__ method in A from B, what is the line of code you should write?

A.__init__(self)
B.__init__(self)
A.__init__(B)
B.__init__(A)

2. What will be the output of below Python code?

tupl=("annie","hena","sid")
print(tupl[-3:0])

("annie")
()
None
Error as slicing is not possible in tuple.

3. Which character stand for Zero or more occurrences in regex?

*
#
@
|

4. Parent class is the class being inherited from, also called?

derived class
Child class
Hybrid class
base class

5. What will be the output of following Python code?

list1=[1,3,4,2]
x=list1.pop(2)
print(set([x]))

{1,3,4}
{1,3,2}
{2}
{4}

6. In which part of memory does the system stores the parameter and local variables of funtion call?

heap
stack
Uninitialized data segment
None of the above

7. What will be the output of above Python code?

d1={"abc":5,"def":6,"ghi":7}
print(d1[0])

abc
5
{"abc":5}
Error

8. What will be the output of the following code?

x = "abcdef"
i = "i"
while i in x:
print(i, end=" ")

a b c d e f
abcdef
i i i i i.....
No Output

9. What will be the output of the following Python code?

def fn():
global var1
var1=10
var1=var1*5
print(var1)
var1=5
fn()
print(var1)

25
     5
50
     5
25
     25
50
     50

10. How many keywords are there in python 3.7?

32
33
31
30

Results