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. Choose the correct option with reference to below Python code?

def fn(a):
print(a)
x=90
fn(x)

x is the formal argument.
a is the actual argument.
fn(x) is the function signature.
x is the actual argument.

2. Suppose a tuple arr contains 10 elements. How can you set the 5th element of the tuple to 'Hello'?

arr[4] = 'Hello'
arr(4) = 'Hello'
arr[5] = 'Hello'
Elements of tuple cannot be changed

3. Which of the following is incorrect?

List is a built-in data structure in Python
List can only have elements of same data type.
List is mutable.
Index of lists can be positive as well as negative.

4. What is a python file with .py extension called?

package
module
directory
None of the above

5. What is the extension of python file?

.p
.py
.python
None of the above

6. Which function returns a list containing all matches?

findall
search
split
find

7. Which of the following Python code will create a set?
(i) set1=set((0,9,0))
(ii) set1=set([0,2,9])
(iii) set1={}

iii
i and ii
ii, iii
All of the above

8. Which of the following are in correct order with respect to conditional statements in Python?
(i) if
(ii) else
(iii) elif

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

9. Which of the following is False regarding loops in Python?

Loops are used to perform certain tasks repeatedly.
While loop is used when multiple statements are to executed repeatedly until the given condition becomes False
While loop is used when multiple statements are to executed repeatedly until the given condition becomes True.
for loop can be used to iterate through the elements of lists.

10. "in" is a operator in python?

True
False
Neither true nor false
None of the above

Results