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. What will following Python code return?

str1="Stack of books"
print(len(str1))

13
14
15
16

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

set1={0,0,9}
print(set1)

{0,0,9}
{0,9}
{9}
It will throw an error as there are two 0 while creating the set.

3. Which of the following options will not result in an error when performed on tuples in Python where tupl=(5,2,7,0,3)?

tupl[1]=2
tupl.append(2)
tupl1=tupl+tupl
tupl.sort()

4. The expression a{5} will match _____________ characters with the previous regular expression.

5 or less
exactly 5
5 or more
exactly 4

5. Which of these are keyword?

in
is
assert
All of the above

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. Which of the following sequences would be generated bt the given line of code?

range (5, 0, -2)

5 4 3 2 1 0 -1
5 4 3 2 1 0
5 3 1
None of the above

8. What will be the output of the following code

 a = 1
b = ++a
print(b is a)

True
False
Error
None of the above

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

10. The ________ statement is a null operation.

break
exit
return
pass

Results