def get_digit(value, arg):
 try:
  arg = int(arg)
  value = int(value)
 except ValueError:
  return value
 if (arg < 1):
  return value
 try:
  return int(str(value)[(- arg)])
 except IndexError:
  return 0

def get_digit ( value , arg ) : try : arg = int ( arg ) value = int ( value ) except ValueError : return value if ( arg < 1 ) : return value try : return int ( str ( value ) [ ( - arg ) ] ) except IndexError : return 0
given a whole number .