4.15 LAB: Parity of Numbers The code template below partially…
Question 4.15 LAB: Parity of Numbers The code template below partially… 4.15 LAB: Parity of NumbersThe code template below partially defines a function called check_parity() with a single argument called dob. (Functions will be considered in detail in Chapter 6.) The purpose of check_parity() is to return the string literal ‘Even’ if dob is an even integer, and ‘Odd’ if it is odd. The return statement at the end of the function definition indicates that the value of the variable parity is what the function returns. Where indicated, insert code that correctly assigns the value of the variable parity.The code in the main body interprets input from the user in the form of a slash-delimited date string (MM/DD/YYYY) and sums the month, day, and year integers into a single value that is passed to check_parity(). The result of the call to check_parity() is output.For example, if the user input is 12/8/1996, the code computes 12+8+1996, passes the result to check_parity(), which produces output:Even Image transcription textLAB ACTIVITY 4.15.1: LAB: Parity of Numbers main.py 1 def check_parity (dob) : Return ‘Even’ if dob is even, or’Odd’ otherwise. 3 4 # Your solution goes here 5… Show more Computer Science Engineering & Technology Python Programming CS 110 Share QuestionEmailCopy link Comments (0)


