Question: PYTHON: QUESTION 1: Even or Odd . 2. Ask the user for a positive integer number. 3. Write the code to determine if a value
PYTHON:
QUESTION 1: Even or Odd .
2. Ask the user for a positive integer number.
3. Write the code to determine if a value is even or odd. If the value is even, print a message in the format: " value is even."; otherwise, print a message in the format: " value is odd." In both examples provided value is the inputted value.
Note: A value is even when its remainder is 0. The modulus calculates the remainder and is represented by the ' % ' operator. Type the code in fig. 1a into the python shell to see the outputted value. This shows the output from the modulus operator. In the example 1b provided, we see that this value can be used as part of a conditional statement.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
