Created
July 1, 2021 06:29
-
-
Save Abhayparashar31/a5cd3323b9fb31731f1b375829924ace to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Check_number : | |
| def even_or_odd(func) : | |
| def check(self, num) : | |
| func(self, num) | |
| if num % 2 == 0 : | |
| print(f'{num} is an EVEN Number') | |
| else : | |
| print(f'{num} is an ODD Number.') | |
| return check | |
| @even_or_odd | |
| def is_even(self, num) : | |
| print('Input : ', num) | |
| obj = Check_number() | |
| obj.is_even(63) | |
| obj.is_even(22) | |
| obj.is_even(71) | |
| ''' | |
| Input : 63 | |
| 63 is an ODD Number. | |
| Input : 22 | |
| 22 is an EVEN Number | |
| Input : 71 | |
| 71 is an ODD Number. | |
| ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment