SART experıment

Numbers 1-9 are randomly displayed and all numbers except the number 3 need to be pressed on the space key. If the space key is pressed when the number 3 is displayed and the space key is not pressed when the other numbers are displayed, an “error” message should be given as feedback. but I can’t generate this feedback code. how can I do it. thank you so much