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 one of the following is a valid Python if statement :

if a>=2 :
if (a >= 2)
if (a => 22)
if a >= 22

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

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

def function1(var1):
    var1=var1+10
    print (var1)
var1=12
function1(var1)
print(var1)

22
     22
12
     12
22
     22
12
     22

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

class Student:
def __init__(self,name,id):
self.name=name
self.id=id
print(self.id)
std=Student("Simon",1)
std.id=2
print(std.id)

1
    1
1
    2
2
    1
2
    2

5. Python is written in which language?

C
C++
Java
None of the above

6. Which of the following will give output as [23,2,9,75] ?

If list1=[6,23,3,2,0,9,8,75]

print(list1[1:7:2])
print(list1[0:7:2])
print(list1[1:8:2])
print(list1[0:8:2])

7. Which one of the following is the correct way of calling a function?

function_name()
call function_name()
ret function_name()
function function_name()

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

package
module
directory
None of the above

9. Python programming language allows to use one loop inside another loop known as?

switch
foreach
nested
forall

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

list1=["tom","mary","simon"]
list1.insert(5,8)
print(list1)

["tom", "mary", "simon", 5]
["tom", "mary", "simon", 8]
[8, "tom", "mary", "simon"]
Error

Results