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

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
KRIS NIKOLAISEN
54,331 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