Summary
We are considering the following example:
For Example
If x= 6
Output:
Even
If x=7
Output:
Odd
Let’s assume:
If the number is even function returns True or else False.
Solution
Here is the code:
#User function Template for python3 def checkOddEven(x): if(x % 2 == 0): # Complete the statement below return True else: # Complete the statement below return False |
Answered by:> >piyushha4q7m
Credit:> >GeekforGeeks
Suggested blogs:
>How to configure python in jmeter?
>How to mock a constant value in Python?
>Creating a pivot table by 6 month interval rather than year
>How to Install mariaDB client efficiently inside docker?
>Can I call an API to find out the random seed in Python `hash()` function?
>How remove residual lines after merge two regions using Geopandas in python?