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. Which of the following is correct?

class A:
def __init__(self):
self.count=5
self.count=count+1
a=A()
print(a.count)

5
6
0
Error

2. Which of the following are in correct order with respect to conditional statements in Python?
(i) if
(ii) else
(iii) elif

i, iii, ii
ii, iii ,i
iii, ii, i
ii, i, iii

3. Why are local variable names beginning with an underscore discouraged?

they confuse the interpreter
they are used to indicate a private variables of a class
they are used to indicate global variables
they slow down execution

4. Which of the following is correct with respect to above Python code?

d={"a":3,"b":7}

a dictionary d is created.
a and b are the keys of dictionary d.
3 and 7 are the values of dictionary d
All of the above.

5. What is setattr() used for?

To set an attribute
To access the attribute of the object
To check if an attribute exists or not
To delete an attribute

6. A loop becomes infinite loop if a condition never becomes ________.

TRUE
FALSE
Null
Both A and C

7. By the use of which character, single line is made comment in Python?

*
@
#
!

8. Which of the following is not used as loop in Python?

for loop
while loop
do-while loop
None of the above

9. What will be the result after the execution of above Python code?

list1=[3,2,5,7,3,6]
list1.pop(3)
print(list1)

[3,2,5,3,6]
[2,5,7,3,6]
[2,5,7,6]
[3,2,5,7,3,6]

10. A class variable or instance variable that holds data associated with a class and its object is known as?

Class variable
Method 
Operator overloading
Data member

Results