Python Operators
Question 1 |
What is the output of the following code :
Python3
print 9//2
4.5 | |
4.0 | |
4 | |
Error |
Discuss it
Question 1 Explanation:
The โ//โ operator in Python returns the integer part of the floating number.
Question 2 |
Which function overloads the >> operator?
more() | |
gt() | |
ge() | |
None of the above |
Discuss it
Question 2 Explanation:
rshift() overloads the >> operator
Question 3 |
Which operator is overloaded by the or() function?
|| | |
| | |
// | |
/ |
Discuss it
Question 3 Explanation:
or() function overloads the bitwise OR operator
Question 4 |
What is the output of the following program :
Python3
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 |
Discuss it
Question 4 Explanation:
There is no operator ++ in Python
There are 4 questions to complete.


