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. What will the above Python code do?

dict={"Phy":94,"Che":70,"Bio":82,"Eng":95}
dict.update({"Che":72,"Bio":80})

It will create new dictionary as dict={"Che":72,"Bio":80} and old dict will be deleted.
It will throw an error as dictionary cannot be updated.
It will simply update the dictionary as dict={"Phy":94,"Che":72,"Bio":80,"Eng":95}
It will not throw any error but it will not do any changes in dict

2. What will be the result of above Python code?

dict={"Joey":1,"Rachel":2}
dict.update({"Phoebe":2})
print(dict)

{"Joey":1,"Rachel":2,"Phoebe":2}
{"Joey":1,"Rachel":2}
{"Joey":1,"Phoebe":2}
Error

3. What is the output of the following code : print 5//2

2
2.5
2.0
Error

4. Which of the following statment is False?

Variable names can be arbitrarily long.
They can contain both letters and numbers.
Variable name can begin with underscore.
Variable name can begin with number.

5. When does the else statement written after loop executes?

When break statement is executed in the loop
When loop condition becomes false
Else statement is always executed
None of the above

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

None
0
Null
Arbitary value

7. Which of the follwing are the keys in the given statement : abc = {"first":10, "second":20}

10, 20
first, second
first, 10, second, 20
first, 20

8. A loop becomes infinite loop if a condition never becomes ________.

TRUE
FALSE
Null
Both A and C

9. When a child class inherits from only one parent class, it is called?

single inheritance
singular inheritance
Multiple inheritance
Multilevel inheritance

10. Which of the following function headers is correct?

def fun(a = 2, b = 3, c)
def fun(a = 2, b, c = 3)
def fun(a, b = 2, c = 3)
def fun(a, b, c = 3, d)

Results