Where is the coding error for the unexpected ‘}’ in this if / else choice of loops?

Where is the coding error for the unexpected ‘}’ in this if / else choice of loops?