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

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 Dec 14, 2019 in Python by sheetalkhandelwal
0 votes
asked Jan 13, 2021 in Python by SakshiSharma
0 votes
asked Apr 24 in SAP ABAP by sharadyadav1986