Have you ever pushed a doorbell button? The second you press it, DING, a sound plays. In computer science, that button push is called an event. An event is something that happens, like a click, a tap, or a key press, and it tells the computer to do something right away.
Code is a list of instructions for a computer. But sometimes the code needs to wait until the right moment to run. The event is the signal that shouts go now. Without the event, the code just sits and waits, like a runner waiting for the starting whistle.
Think about a video game. When you press the spacebar, your character jumps. Pressing that key is the event. The jumping is the code that runs because of the event. Every button in the game is waiting for you to make something happen.
Events happen all around you on computers and phones. Tapping an app to open it is an event. Typing a letter on a keyboard is an event. Even moving your mouse can be an event that the computer notices and reacts to.
When you build your own programs, you get to choose which events do what. You might say that when the green flag is clicked, the music should start. You are the boss who connects each event to the code you want it to start.
So remember, an event is a signal, and code is the action that answers it. Events are how people talk to computers, one click, tap, or key press at a time.