Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ This function only tests if an integer argument
- is an even number or odd """
- # The function is named even_or_odd and it accepts an integer argument
- def even_or_odd(number):
- # The block test for oddity or eveness and it returns the appropriate string
- if number % 2 == 0:
- return "even"
- else:
- return "odd"
- # Function Invokation
- print(even_or_odd(2))
- print(even_or_odd(0))
- print(even_or_odd(13))
- print(even_or_odd(9))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement