Question: The code produces an error. Please understand the error and try to fix it.

print(type("Hey".replace("ey","i")[-1])

Hint: An open bracket always needs a closing bracket.