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 operator is used to calculate power of x raise to y.

x^y
x*y
x**y
None of the above

2. What will be the following Python code?

dict1={"a":10,"b":2,"c":3}
str1=""
for i in dict1:
    str1=str1+str(dict1[i])+" "
    str2=str1[:-1]
print(str2[::-1])

3, 2
3, 2, 10
3, 2, 01
Error

3. Suppose a tuple arr contains 10 elements. How can you set the 5th element of the tuple to 'Hello'?

arr[4] = 'Hello'
arr(4) = 'Hello'
arr[5] = 'Hello'
Elements of tuple cannot be changed

4. The continue statement can be used in?

while loop
for loop
do-while
Both A and B

5. The following Python code will result in an error if the input value is entered as -5.

TRUE
FALSE
Can be true or false
Can not say

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

delete
dedl
del
drop

7. A return statement with _____ arguments.

No
1
2
Any

8. What will be the output of the following program on execution?

a=0
b=6
x=(a&b)|(a&a | a&b)
y=not(x)
print(y)

6
True
0
False

9. Choose the correct option.

In Python, a tuple can contain only integers as its elements.
In Python, a tuple can contain only strings as its elements.
In Python, a tuple can contain both integers and strings as its elements.
In Python, a tuple can contain either string or integer but not both at a time.

10. Which block lets you test a block of code for errors?

try 
except 
finally 
None of the above

Results