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 is True regarding loops in Python?

Loops should be ended with keyword "end".
No loop can be used to iterate through the elements of strings.
Keyword "break" can be used to bring control out of the current loop.
Keyword "continue" is used to continue with the remaining statements inside the loop.

2. How many local and global variables are there in the following Python code?

var1=5
def fn():
var1=2
var2=var1+5
var1=10
fn()

1 local, 1 global variables
1 local, 2 global variables
2 local, 1 global variables
2 local, 2 global variables

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

str1="6/4"
print("str1")

1
6/4
1.5
str1

4. Which statement will check if a is equal to b?

if a = b:
if a == b:
if a === c:
if a == b

5. If return statement is not used inside the function, the function will return:

None
0
Null
Arbitary value

6. Which one of the following is mutable data type?

set
int
str
tupl

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

8. Which of the following is not a type of argument in Python?

Keyword
Variable argument count
Positional
None of these

9. Which of the following functions clears the regular expression cache?

re.sub()
re.pos()
re.purge()
re.subn()

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

list1=[1,3,5,2,4,6,2]
list1.remove(2)
print(sum(list1))

18
19
21
22

Results