Python quiz and interview questions

Comprehensive Python quiz and questions from basic to advanced level that help you to review your Python knowledge and become the master of Python. Please read the following question carefully and select the correct anwser, you have to make your choice before going to the next question.

Hot and trending quiz topics for Python

Data structure

Data structure (DSA) in Python is well supported by a lot of powerfull class like List,Stack,Queue,Set or Dictionary

Recent added questions

  • What is the output of the following code? Consider Python 2.7.

    print tuple[1:3] if tuple == ( 'abcd', 786 , 2.23, 'john', 70.2 ) else tuple()

     

  • What will be displayed by the following code?

    def f(value, values):
        v = 1
        values[0] = 44
    t = 3
    v = [1, 2, 3]
    f(t, v)
    print(t, v[0])

     

  • What is the output of the following program :

    print 'abcefd'.replace('cd', '12')

     

  • What is the output of the following program :

    print 'abef'.partition('cd')

     

  • What is the output of the following program :

    print 'cd'.partition('cd')

     

  • What is the output of the following program :

    i = 0
    while i < 5:
        print(i)
        i += 1
        if i == 3:
            break
    else:
        print(0)

     

  • What is the output of the following program :

    i = 0
      while i < 3:
         print i
         i += 1
      else:
         print 0

     

  • What is the output of the following program :
     

    print '{0:-2%}'.format(1.0 / 3)

     

View all Python quiz questions

© 2017 QuizBucket.org