human
Check if a number is positive , negative or zero using bit operators | function to return 1 if it is zero returns 0 if it is negative returns 2 if it is positive.
string array to store all kinds of number.
function call to check the sign of number.
driver program to test the above function"
How can the above be solved in Python?
assistant
#Here is code to check if a number is positive , negative or zero using bit operators and the other steps required.
 def index ( i ) :
	return 1 + ( i >> 31 ) - ( - i >> 31 )
def check ( n ) :
	s = " negative " , " zero " , " positive "
	val = index ( n )
	print ( n , " is " , s [ val ] )
check ( 30 )
check ( - 20 )
check ( 0 )