Python Online Quiz – It’s exam time for python aspirants

Python course with 57 real-time projects - Learn Python

Searching for a good quiz to test your Python knowledge? Your search ends here. This Python online quiz is for intermediate and advanced learners.

It will not only help you to test your knowledge but also discover your strengths and weaknesses with Python.

Attempt other parts of the Python quiz once you are done with this part:

So, let’s play the Python online quiz.

Here we come to the end of the Python Quiz. Hope you enjoyed it!!!

If you have any queries and suggestions regarding the Python online quiz, share it in the comment section.

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

follow dataflair on YouTube

17 Responses

  1. apeksha jain says:

    If i am not wrong the Q.8 answer would be 1 instead 0.

    • DataFlair Team says:

      Hello Apeksha,

      The answer is zero as Python uses round to even strategy for .5 values. Try running the script in Python and you will understand.

  2. Pavan Kumar Korlakunta says:

    for 12th question the answer is option a it’s not b,if we use l2=l1 then option b is correct but here you used l2=l1.copy() while using this statement it cannot affect the l1 list

    • Max says:

      l2=l1.copy() creates a shallow copy. The reference to the list [2, 3] is copied, not the list itself.
      Therefore l1 is affected.

    • DataFlair says:

      “The correct option is option b becasue we have created copy of the list l1. But we are modifying the element of the list element inside the list. But if we modify the list element as a whole, your anser would have been correct. For example, if the code would have been l1 = [1, [2, 3], 4]
      l2 = l1.copy()
      print(l1, l2) Then the output would have been [1, [2, 3], 4] [1, 7, 4]. Hope I could answer your question.”

  3. Adeleke Dare says:

    Hello, I am new to programming and I wish to enrol in the course so that I can have access to your facilitators but I am financially incapable. Please, If I can go through all the tutorials in the blogs and creating a portfolio with the projects on the website, will they be enough for me to develop something on my own or secure a job.


  4. vpbisht says:

    def show(list,length):
    print(list[length-1],end= ”)

    I am getting 5[1, 2, 3, 4, 5] 4, do I missed something here.

    • Lakshmeesha Kadamannaya says:

      In the function, the 3rd line should be ‘show(list, length-1)’ instead of ‘print(list,length-1)’

    • DataFlair says:

      This output you gave for this code is correct. But this code is different from the one given in question 14. The third line should be show(list, length-1). Hope I could solve your query.

  5. Lakshmeesha Kadamannaya says:

    Very nice, this set of questions is little tough as compared previous two sets.

  6. Durga says:


  7. SYBCS_05_Gayatri Bhorade says:

    Python Quiz
    part 1= 100%
    Part 2 = 85.71%
    Part3 = 100%

  8. Alexandru Gheorghe Muntenaș says:

    Hello. I have a questio about Q13 size of a tuple.
    Why Python tells me that the empty tuple has 40bytes?

    import sys
    print(“Size of tuple: ” + str(sys.getsizeof(tuple)) + “bytes”)

    Size of tuple: 40bytes


    when i use my pc ().__sizeof__() the result is 24
    when i use my android (pydroid 3) the result is 12


    python quiz 3
    option 2
    “s[:] is s” should return False

Leave a Reply

Your email address will not be published. Required fields are marked *