Quiz: Python Basics Revision

10 Questions | Total Attempts: 40

SettingsSettingsSettings
Please wait...
Quiz: Python Basics Revision

This quiz will test your basic knowledge of python as part of revision of your class XI concepts.


Questions and Answers
  • 1. 
    What is a correct syntax to output "Hello World" in Python?
    • A. 

      Print("hello world");

    • B. 

      Print("hello world")

    • C. 

      Printer("hello world");

    • D. 

      Printing("hello world");

  • 2. 
    Which operator is right-associative
    • A. 

      *

    • B. 

      =

    • C. 

      +

    • D. 

      %

  • 3. 
    What is the output of the following program? L = list('123456')  L[0] = L[5] = 0 L[3] = L[-2]  print(L)   
    • A. 

      [0, ‘2’, ‘3’, ‘4’, ‘5’, 0]

    • B. 

      [‘6’, ‘2’, ‘3’, ‘5’, ‘5’, ‘6’]

    • C. 

      [‘0’, ‘2’, ‘3’, ‘5’, ‘5’, ‘0’]

    • D. 

      [0, ‘2’, ‘3’, ‘5’, ‘5’, 0]

  • 4. 
    Which of these is not a core data type?
    • A. 

      List

    • B. 

      Dictionary

    • C. 

      Tuple

    • D. 

      Class

  • 5. 
    What is the Output of following program? a = 4.5 b = 2 print a//b 
    • A. 

      2

    • B. 

      2.0

    • C. 

      2.25

    • D. 

      3

  • 6. 
    What is the output of following program? a = True b = False c = False    if not a or b:     print 1 elif not a or not b and c:     print 2 elif not a or b or not b and a:     print 3 else:     print 4
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 7. 
    What is the output of following program? list1 = ['physics', 'chemistry', 1997, 2000] print ("list1: ", list1[1:]) 
    • A. 

      List1: ['physics', 'chemistry', 1997, 2000]

    • B. 

      List1:  ['chemistry', 1997, 2000]

    • C. 

      ['physics', 'chemistry', 1997, 2000]

    • D. 

      ['chemistry', 1997, 2000]

  • 8. 
    What will be the output of the following Python statement? >>>"a"+"bc"
    • A. 

      A

    • B. 

      Bc

    • C. 

      Acb

    • D. 

      Abc

  • 9. 
    Which of the following is a Python tuple?
    • A. 

      [1,2,3,4]

    • B. 

      (1,2,3,4)

    • C. 

      {1,2,3,4}

    • D. 

      {}

  • 10. 
    What will be the output of the following Python code snippet? d = {"john":40, "peter":45} print("john" in d)
    • A. 

      True

    • B. 

      False

    • C. 

      Error

    • D. 

      None

Back to Top Back to top