0

can anyone explain me the output of "print 24|42 " in python

8th May 2017, 1:37 AM
Vijay Mhaske
Vijay Mhaske - avatar
2 odpowiedzi
+ 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
8th May 2017, 10:53 AM
visph
visph - avatar
+ 2
It will give you error unless you remove string from print. like this. print( '24/42')
8th May 2017, 2:01 AM
Ayush Kumar Singh
Ayush Kumar Singh - avatar