Challenge 2: Check Parity of a Number
Parity is a term to express if a given integer is even or odd.
checkParity(n) function, write code to determine if a given number
n is even or odd. Think of this as a function that returns 0 if the number is even, and 1 if it is odd. You have been given some starter code where the function and return statement have already been written, so don’t worry about any Python-specific details about functions; just implement the function logic!
The parity of the number
Check the Python library reference for more details!
Write your code below. It is recommended that you try solving the exercise yourself before viewing the solution.