How to make a program differentiate odd and even numbers in python [closed]

0

Hello, good evening I would like to learn how to make a program differentiate odd even numbers.

I have to learn about what?

    
asked by anonymous 11.05.2017 / 04:29

1 answer

1

You need to use an operator called a module, because it will do the division of the number, and it will return the rest to you, that way if a number divided by 2 returns zero, it will be even otherwise it will be odd.

example:

4 % 2 == 0 return of this operation will be 0 or the number is even

5 % 2 == 0 in this case the return will be 1 or the number is odd

    
11.05.2017 / 04:38