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 block lets you test a block of code for errors?

try 
except 
finally 
None of the above

2. What is the output of the following program : print((1, 2) + (3, 4))

(1, 2), (3, 4)
(4, 6)
(1, 2, 3, 4)
Invalid Syntax

3. Which of the following is False with respect Python code?

class Student:
def __init__(self,id,age):
self.id=id
self.age=age
std=Student(1,20)

"std" is the reference variable for object Student(1,20)
id and age are called the parameters.
Every class must have a constructor.
None of the above

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

str1="poWer"
str1.upper()
print(str1)

POWER
Power
power
poWer

5. Function blocks begin with the keyword?

define
fun
function
def

6. "in" is a operator in python?

True
False
Neither true nor false
None of the above

7. Which one of the following is correct way of declaring and initialising a variable, x with value 5?

int x
     x=5
int x=5
x=5
declare x=5

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

tuple1=(2,4,3)
tuple3=tuple1*2
print(tuple3)

(4,8,6)
(2,4,3,2,4,3)
(2,2,4,4,3,3)
Error

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

n=7
c=0
while(n):
if(n>5):
c=c+n-1
n=n-1
else:
break
print(n)
print(c)

5 11
5 9
7 11
5 2

10. In Python, how are arguments passed?

pass by value
pass by reference
It gives options to user to choose
Both A and B

Results