def getIsBracketed(word):
 if (len(word) < 2):
  return False
 firstCharacter = word[0]
 lastCharacter = word[(-1)]
 if ((firstCharacter == '(') and (lastCharacter == ')')):
  return True
 return ((firstCharacter == '[') and (lastCharacter == ']'))

def getIsBracketed ( word ) : if ( len ( word ) < 2 ) : return False firstCharacter = word [ 0 ] lastCharacter = word [ ( - 1 ) ] if ( ( firstCharacter == '(' ) and ( lastCharacter == ')' ) ) : return True return ( ( firstCharacter == '[' ) and ( lastCharacter == ']' ) )
determine if the word is bracketed .