0
can anyone explain me the output of "print 24|42 " in python
2 Answers
+ 6
In Python3 only it will give you an error, because "print" is no longer a statemet, but a function: you must enclose their parameters inside parenthesis ( rounded brackets ):
print(24|42)
... the output is 58, as the pipe character ( | ) is a "bitwise operator", the binary OR:
https://wiki.python.org/moin/BitwiseOperators
https://www.tutorialspoint.com/python/bitwise_operators_example.htm
+ 2
It will give you error unless you remove string from print. like this.
print( '24/42')