- replace string bracket notation with string.endswith() function call