Site icon DataFlair

Advanced Python Quiz to Test Your Knowledge

advanced python quiz

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!!!

Time limit: 0

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

Quiz complete. Results are being recorded.

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

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  1. Current
  2. Review / Skip
  3. Answered
  4. Correct
  5. Incorrect
  1. Question 1 of 30
    1. Question

    What is the importance of the init method in a class?

    Correct
    Incorrect
  2. Question 2 of 30
    2. Question

    Which of the following uses a divide and conquer algorithm?

    Correct
    Incorrect
  3. 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]

    Correct
    Incorrect
  4. 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

    Correct
    Incorrect
  5. Question 5 of 30
    5. Question

    What is the method that is bound to class but not the instance?

    Correct
    Incorrect
  6. Question 6 of 30
    6. Question

    What is a generator in Python?

    Correct
    Incorrect
  7. 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)

    Correct
    Incorrect
  8. Question 8 of 30
    8. Question

    Which of the following is true about the stack?

    Correct
    Incorrect
  9. Question 9 of 30
    9. Question

    Find the output of the below code.

    import re

    print(re.search(‘aa?cb?’,’aacb aaccbd’).group())

    Correct
    Incorrect
  10. 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])

    Correct
    Incorrect
  11. Question 11 of 30
    11. Question

    Which of the following is used to print the doc string of a function?

    Correct
    Incorrect
  12. Question 12 of 30
    12. Question

    What is the output of the below code?

    a1,b1,c1=1,2,3,4,5

    print(b1)

     

    Correct
    Incorrect
  13. Question 13 of 30
    13. Question

    Find the output of the below code.

    tup=(9)

    print(tup*4)

    Correct
    Incorrect
  14. Question 14 of 30
    14. Question

    Which of the following commands is used to find the status of a thread?

    Correct
    Incorrect
  15. Question 15 of 30
    15. Question

    What is the output of the below code?

    List=list(range(-5,5,2))

    len(List)

    Correct
    Incorrect
  16. Question 16 of 30
    16. Question

    Find the output of the below code.

    string=’abcderbct’

    print  (string.partition(‘bc’))

    (‘a’, ‘bc’, ‘derbct’)

    Correct
    Incorrect
  17. 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’?

    Correct
    Incorrect
  18. 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

    Correct
    Incorrect
  19. Question 19 of 30
    19. Question

    Which of the following is the correct command to add a column to a table?

    Correct
    Incorrect
  20. Question 20 of 30
    20. Question

    Which of the following commands is used to get the data obtained by executing the last query?

    Correct
    Incorrect
  21. Question 21 of 30
    21. Question

    Which function is used to read n bytes of information from a text file?

    Correct
    Incorrect
  22. Question 22 of 30
    22. Question

    Which commands return the columns of a dataframe?

    Correct
    Incorrect
  23. 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]))

    Correct
    Incorrect
  24. 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’?

    Correct
    Incorrect
  25. Question 25 of 30
    25. Question

    Which of the following creates two grids on a row for plotting 2 graphs in matplotlib?

    Correct
    Incorrect
  26. Question 26 of 30
    26. Question

    What is the output of the below code?

    cv2.threshold(pic, 125, 255, cv2.THRESH_OTSU)

    Correct
    Incorrect
  27. Question 27 of 30
    27. Question

    What is the process of converting the data into byte form in Python?

    Correct
    Incorrect
  28. 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))

    Correct
    Incorrect
  29. Question 29 of 30
    29. Question

    Find the output of the below code.

    len(list((zip(‘abc’,[5,4,3,2,1]))))

     

    Correct
    Incorrect
  30. Question 30 of 30
    30. Question

    What is the output of the following code?

    list(enumerate([‘a’,’b’,’c’,’d’,’e’],100))[0][0]

    Correct
    Incorrect

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!

Exit mobile version