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 correct with respect to above Python code?

d={"a":3,"b":7}

a dictionary d is created.
a and b are the keys of dictionary d.
3 and 7 are the values of dictionary d
All of the above.

2. What will be the result of following Python code snippet after execution?

a=0
b=1
if (a and b):
print("hi")
elif(not(a)):
print("hello")
elif(b):
print("hi world")
else:
print("hello world")

hello world
hi
hi world
hello

3. _____ represents an entity in the real world with its identity and behaviour.

A method
An object
A class
An operator

4. Which one of the following is False regarding data types in Python?

In python, explicit data type conversion is possible
Mutable data types are those that can be changed.
Immutable data types are those that cannot be changed.
None of the above

5. What is the output of following: set([1,1,2,3,4,2,3,4])

[1,1,2,3,4,2,3,4]
{1,2,3,4}
{1,1,2,3,4,2,3,4}
Invalid Syntax

6. Which of the following will result in an error?

str1="python"

print(str1[2])
str1[1]="x"
print(str1[0:9])
Both (b) and (c)

7. Which of these are keyword?

in
is
assert
All of the above

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

delete
dedl
del
drop

9. Which one of the following is incorrect?

The variables used inside function are called local variables.
The local variables of a particular function can be used inside other functions, but these cannot be used in global space
The variables used outside function are called global variables
In order to change the value of global variable inside function, keyword global is used.

10. Python was developed in which year?

1972
1995
1989
1981

Results