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. By the use of which character, single line is made comment in Python?

*
@
#
!

2. Which one is false regarding local variables?

These can be accessed only inside owning function
Any changes made to local variables does not reflect outside the function.
These remain in memory till the program ends
None of the above

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

None
0
Null
Arbitary value

4. A while loop in Python is used for what type of iteration?

indefinite
discriminant
definite
indeterminate

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

x = "abcdef"
i = "i"
while i in x:
print(i, end=" ")

a b c d e f
abcdef
i i i i i.....
No Output

6. What will be output for the folllowing code?

x=10
y=8
assert x>y, 'X too small

Assertion Error
10 8
No output
108

7. Which of the following is incorrect regarding variables in Python?

Variable names in Python cannot start with number. However, it can contain number in any other position of variable name.
Variable names can start with an underscore.
Data type of variable names should not be declared
None of the above

8. Which of the following statements is false?

A non-private method in a superclass can be overridden
A derived class is a subset of superclass
The value of a private variable in the superclass can be changed in the subclass
When invoking the constructor from a subclass, the constructor of superclass is automatically invoked

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 many objects and reference variables are there for the given Python code?

class A:
	print("Inside class")
A()
A()
obj=A()

2 and 1
3 and 3
3 and 1
3 and 2

Results