Python Operators

Last Updated :
Discuss
Comments

Question 1

What is the output of the following code : 

Python
print(9//2)
  • 4.5

  • 4.0

  • 4

  • Error

Question 2

Which function overloads the >> operator?

  • more()

  • gt()

  • ge()

  • None of the above

Question 3

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

  • __or__()

  • __and__()

  • __xor__()

  • __rshift__()

Question 4

What is the output of the following program : 

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

  • 0 1 2 3 4 5

  • Error

  • 1 0 2 4 3 5

There are 4 questions to complete.

Take a part in the ongoing discussion