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

Mina Salehi
Mina Salehi
1,282 Points

my code is running correctly in workspace but i keep getting errors on practice forum

create_a_function.py
def is_odd(num):
    num_check = num % 2
    if num_check == 0:
        print("False")
    else:
        print("True")

num_value = int(input("plese enter a number:   "))

is_odd(num_value)

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,735 Points

Some hints:

  • the challenge expects you to return values not print them.
  • the values to return are booleans
  • only include the code for the function. remove any test code.
Mina Salehi
Mina Salehi
1,282 Points

Thanks it seems i have a hard time understanding what challenges expect :/