The below code will do the job:
Here, we start off by creating a method, with the name ‘even_odd()’. This function takes a single parameter and prints out if the number taken is even or odd.
Now, let’s invoke the function:
We see that, when 5 is passed as a parameter into the function, we get the output -> ‘5 is odd’.