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. Choose the correct option with reference to below Python code?

def fn(a):
print(a)
x=90
fn(x)

x is the formal argument.
a is the actual argument.
fn(x) is the function signature.
x is the actual argument.

2. In python, what is method inside class?

attribute
object
argument
function

3. Which of the following is a valid for loop in Python?

for(i=0; i < n; i++)
for i in range(0,5):
for i in range(0,5)
for i in range(5)

4. How many times will the loop run?

i=2
while(i>0):
i=i-1

2
3
1
0

5. How to get last element of list in python? Suppose we have list with name arr, contains 5 elements.

arr[0]
arr[5]
arr[last]
arr[-1]

6. Which of the following statements is true?

Python is a high level programming language.
Python is an interpreted language.
Python is an object-oriented language
All of the above

7. 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.

8. Which of the following Python code will give different output from the others?

for i in range(0,5):
    print(i)
for j in [0,1,2,3,4]:
    print(j)
for k in [0,1,2,3,4,5]:
    print(k)
for l in range(0,5,1):
    print(l)

9. What is the output of the following code : print 5//2

2
2.5
2.0
Error

10. The __________ parameter is a reference to the current instance of the class, and is used to access variables that belong to the class.

__init__()
self
both A and B
None of the above

Results