Check if an Octal number is Even or Odd | Check if the number is odd or even ; Check if the last digit is either '0' , '2' , '4' , or '6 ; Driver code
def even_or_odd ( N ) : NEW_LINE INDENT l = len ( N ) ; NEW_LINE DEDENT ' NEW_LINE INDENT if ( N [ l - 1 ] == '0' or N [ l - 1 ] == '2' or N [ l - 1 ] == '4' or N [ l - 1 ] == '6' ) : NEW_LINE INDENT return ( " Even " ) NEW_LINE DEDENT else : NEW_LINE INDENT return ( " Odd " ) NEW_LINE DEDENT DEDENT N = "735" NEW_LINE print ( even_or_odd ( N ) ) NEW_LINE