human
Check if a N base number is Even or Odd | To return value of a char ..
Function to convert a number from N base to decimal.
power of base.
Decimal equivaLent is str [ Len - 1 ] * 1 + str [ Len - 1 ] * base + str [ Len - 1 ] * ( base ^ 2 ) + ....
A digit in input number must be less than number 's base.
Returns true if n is even , else odd.
Driver code"
Solution in Python:
 ... Can you provide a code to check if a N base number is Even or Odd and the other steps required?
assistant
#Here is code to check if a N base number is Even or Odd and the other steps required.
 def val ( c ) :
	if ( ord ( c ) >= ord ( '0' ) and ord ( c ) <= ord ( '9' ) ) :
		return ord ( c ) - ord ( '0' )
	else :
		return ord ( c ) - ord ( ' A ' ) + 10
def toDeci ( str , base ) :
	Len = len ( str )
	power = 1
	num = 0
	for i in range ( Len - 1 , - 1 , - 1 ) :
		if ( val ( str [ i ] ) >= base ) :
			print ( " Invalid ▁ Number " )
			return - 1
		num += val ( str [ i ] ) * power
		power = power * base
	return num
def isEven ( num , N ) :
	deci = toDeci ( num , N )
	return ( deci % 2 == 0 )
if __name__ == ' _ _ main _ _ ' :
	num = "11A "
	N = 16
	if ( isEven ( num , N ) ) :
		print ( " Even " )
	else :
		print ( " Odd " )