Can anyone tell me is this code is correct or not to find odd or even number through define function

1m

def odd_even(num):
if num%2== 0:
return “even”
else:
return “odd”
print(odd_even(8))

can any one tell

For me it seems ok, unless you messed up the indentation.

If it shows something like IndentationError then you formatted the code incorrectly.

1 Like

it shows me nothing after running the code

Post a screenshot of the code/cells you did run.

1 Like