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 of the following will result in error?
(i) list1[3]=list1[2]
(ii) list1[3]=list1[4]
(iii) list1.insert(1,78)
(iv) list1.pop(50)

If list1=[10,20,60,50]

i, iii
i, iv
ii, iv
ii, iii

2. Which of the following is a valid variable?

var@
32var
class
abc_a_c

3. The child's __init__() function overrides the inheritance of the parent's __init__() function.

TRUE
FALSE
Can be true or false
Can not say

4. What will be the output of the following program on execution?

a=0
b=5
x=(a&b)|(a&a)|(a|b)
print("x")

1
5
0
None of the above

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

delete
dedl
del
drop

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

def function1(var1,var2=5):
    var1=2
    var3=var1*var2
    return var3
var1=3
print(function1(var1,var2))

10
15
Error as var2 is not defined while calling the function
Does not give any error as var2 is a default argument

7. Which of the following is False?

String is immutable.
capitalize() function in string is used to return a string by converting the whole given string into uppercase.
lower() function in string is used to return a string by converting the whole given string into lowercase.
None of these.

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

9. Which operator is used to calculate power of x raise to y.

x^y
x*y
x**y
None of the above

10. How to copy one list to another in python?

l1[] = l2[]
l1[] = l2
l1[] = l2[:]
l1 = l2

Results