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 statement is correct?

List is immutable && Tuple is mutable
List is mutable && Tuple is immutable
Both are Mutable.
Both are Immutable

2. Which one of the following is correct?

In python, a dictionary can have two same keys with different values.
In python, a dictionary can have two same values with different keys
In python, a dictionary can have two same keys or same values but cannot have two same key-value pair
In python, a dictionary can neither have two same keys nor two same values.

3. Where is function defined?

Module
class
Another Function
All of the above

4. A return statement with _____ arguments.

No
1
2
Any

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

def function1(var1):
    var1=var1+10
    print (var1)
var1=12
function1(var1)
print(var1)

22
     22
12
     12
22
     22
12
     22

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

7. The ________ statement is a null operation.

break
exit
return
pass

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

def function1(var1=5, var2=7):
    var2=9
    var1=3
    print (var1, " ", var2)
function1(10,12)

5 7
3 9
10 12
Error

9. What is called when a function is defined inside a class?

class
function
method
module

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

x=5
def function1():
global x
y=x+x*2
print(y)
x=7
function1()
print(x)

21
     7
15
     5
21
     5
15
     7

Results