When you introduced else if construction the point was to prevent other branches from executing if one of the conditions was met. Upgrading to for loop brings this issue back. If player, for example, will press both 1 and 2, it will cause both conditions to execute.
You can simply put “break” inside of if-condition and briefly introduce it.