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. A loop becomes infinite loop if a condition never becomes ________.

TRUE
FALSE
Null
Both A and C

2. The ________ statement is a null operation.

break
exit
return
pass

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

list1 = [3 , 2 , 5 , 6 , 0 , 7, 9]
sum = 0
sum1 = 0
for elem in list1:
if (elem % 2 == 0):
sum = sum + elem
continue
if (elem % 3 == 0):
sum1 = sum1 + elem

print(sum , end=" ")
print(sum1)

8 9
8 3
2 3
8 12

4. What will be the output of following Python code snippet?

for i in range(0 , -2 , -1):
print(i)

0, -1
0, -1, -1
-1, -2
Error

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

str1="Information"
print(str1[2:8])

format
formatio
orma
ormat

6. Which of the following will give "Simon" as output?

If str1="John,Simon,Aryan"

print(str1[-7:-12])
print(str1[-11:-7])
print(str1[-11:-6])
print(str1[-7:-11])

7. Which of the following is not a relational opeartor in Python?

>=
<=
=
!=

8. You can delete properties on objects by using the ______ keyword.

delete
dedl
del
drop

9. A variable that is defined inside a method and belongs only to the current instance of a class is known as?

Inheritance 
Instance variable
Function overloading
Instantiation 

10. Which of the following creates a tuple?

tuple1=("a","b")
tuple1[2]=("a","b")
tuple1=(5)*2
None of the above

Results