Python Operators

Last Updated :
Discuss
Comments

Question 1

What is the output of the following code : 

Python
print(9//2)
  • A

    4.5

  • B

    4.0

  • C

    4

  • D

    Error

Question 2

Which function overloads the >> operator?

  • A

    more()

  • B

    gt()

  • C

    ge()

  • D

    None of the above

Question 3

Which special method overloads the bitwise OR (|) operator in Python?

  • A

    __or__()

  • B

    __and__()

  • C

    __xor__()

  • D

    __rshift__()

Question 4

What is the output of the following program : 

Python
i = 0
while i < 3:
       print(i)
       i++
       print(i+1)
  • A

    0 2 1 3 2 4

  • B

    0 1 2 3 4 5

  • C

    Error

  • D

    1 0 2 4 3 5

There are 4 questions to complete.

Take a part in the ongoing discussion