Python Practice Creating and Using Functions in Python Practice Functions That's Odd

Tichaona KUNDODYIWA
Tichaona KUNDODYIWA
5,076 Points

Let's create a function that determines if a specific value is odd. Let's name the function is_odd and have it declare

i am stuck on this one

create_a_function.py
def is_odd(number):
# if number is not divisible by 2 print true.
    # elif number divisible by 2 print false.
    is_odd = number % 2
    return 

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,735 Points

You are close. But you aren't returning anything. Try

def is_odd(number):
# if number is not divisible by 2 print true.
    # elif number divisible by 2 print false.
    return number % 2