+1 vote
in Python by
Write a function, which will take in a value and print out if it is even or odd.

1 Answer

0 votes
by

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’.

Related questions

0 votes
asked Aug 22, 2022 in Python by Robindeniel
0 votes
asked Jan 13, 2021 in Python by SakshiSharma
...