Why is there a 了， and is it necessary?
了 adds some emphasis to the exclaimed statement. The following statements also have the same meanings:
You can also add 哦 to them all to sound friendlier.
So 忘 only is in the default translation here, while in other places Duolingo insists on 忘记?