Advanced Python Quiz to Test Your Knowledge
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python
Hey, we are here with another advanced quiz on Python covering various topics for you to practice. It contains 30 MCQs with both theoretical and coding questions. Let’s start the quiz. All the best!!!
Quiz Summary
0 of 30 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 30 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
- Question 1 of 30
1. Question
What is the importance of the init method in a class?
CorrectIncorrect - Question 2 of 30
2. Question
Which of the following uses a divide and conquer algorithm?
CorrectIncorrect - Question 3 of 30
3. Question
What is the output of the below code?
myList=[1,2,3,5,3,4,6,9]
myList[-6:6]
CorrectIncorrect - Question 4 of 30
4. Question
What is the run time of the below code?
for i in range(n):
j=1
while(j<n):
print(i,j)
j*=2
CorrectIncorrect - Question 5 of 30
5. Question
What is the method that is bound to class but not the instance?
CorrectIncorrect - Question 6 of 30
6. Question
What is a generator in Python?
CorrectIncorrect - Question 7 of 30
7. Question
What is the output of the below code?
def fun(arr):
arr=arr[::-1]
arr=[1,2,3,4,5]
fun(arr)
print(arr)
CorrectIncorrect - Question 8 of 30
8. Question
Which of the following is true about the stack?
CorrectIncorrect - Question 9 of 30
9. Question
Find the output of the below code.
import re
print(re.search(‘aa?cb?’,’aacb aaccbd’).group())
CorrectIncorrect - Question 10 of 30
10. Question
What is the output of the below code?
myList=[‘abc’,’tesdd’,’res’,’treb’]
List2=[ len(x) for x in myList]
print(List2[2])
CorrectIncorrect - Question 11 of 30
11. Question
Which of the following is used to print the doc string of a function?
CorrectIncorrect - Question 12 of 30
12. Question
What is the output of the below code?
a1,b1,c1=1,2,3,4,5
print(b1)
CorrectIncorrect - Question 13 of 30
13. Question
Find the output of the below code.
tup=(9)
print(tup*4)
CorrectIncorrect - Question 14 of 30
14. Question
Which of the following commands is used to find the status of a thread?
CorrectIncorrect - Question 15 of 30
15. Question
What is the output of the below code?
List=list(range(-5,5,2))
len(List)
CorrectIncorrect - Question 16 of 30
16. Question
Find the output of the below code.
string=’abcderbct’
print (string.partition(‘bc’))
(‘a’, ‘bc’, ‘derbct’)
CorrectIncorrect - Question 17 of 30
17. Question
Which of the following is the correct syntax to search for an element ‘n’ in the numpy array ‘ar’?
CorrectIncorrect - Question 18 of 30
18. Question
What is the output of the below code?
import numpy as np
arr=np.array([[1,2,3]])
arr.shape
CorrectIncorrect - Question 19 of 30
19. Question
Which of the following is the correct command to add a column to a table?
CorrectIncorrect - Question 20 of 30
20. Question
Which of the following commands is used to get the data obtained by executing the last query?
CorrectIncorrect - Question 21 of 30
21. Question
Which function is used to read n bytes of information from a text file?
CorrectIncorrect - Question 22 of 30
22. Question
Which commands return the columns of a dataframe?
CorrectIncorrect - Question 23 of 30
23. Question
What is the output of the below code?
list(map(lambda x: x * x, [1,2,3,4,5]))
CorrectIncorrect - Question 24 of 30
24. Question
Which of the following codes merge the union of columns of the dataframes df1 and df2 on the columns ‘clmn’?
CorrectIncorrect - Question 25 of 30
25. Question
Which of the following creates two grids on a row for plotting 2 graphs in matplotlib?
CorrectIncorrect - Question 26 of 30
26. Question
What is the output of the below code?
cv2.threshold(pic, 125, 255, cv2.THRESH_OTSU)
CorrectIncorrect - Question 27 of 30
27. Question
What is the process of converting the data into byte form in Python?
CorrectIncorrect - Question 28 of 30
28. Question
What is the output of the below code?
def fun(n,res=1):
if(n<=0):
return res
return fun(n-1,n*res)
print(fun(5))
CorrectIncorrect - Question 29 of 30
29. Question
Find the output of the below code.
len(list((zip(‘abc’,[5,4,3,2,1]))))
CorrectIncorrect - Question 30 of 30
30. Question
What is the output of the following code?
list(enumerate([‘a’,’b’,’c’,’d’,’e’],100))[0][0]
CorrectIncorrect
Summary
We have reached the end of the Advanced Python quiz and I hope you enjoyed taking it. Please check your mistake(s) to make sure you don’t repeat it again. Happy learning!
Your opinion matters
Please write your valuable feedback about DataFlair on Google

