Printing in functions

My apologies for my very simple question.

I am trying to learn Python and routinely have absolutely no idea what I am doing. I've tried searching for the answer but either I'm using the wrong terminology or it's so obvious that it hasn't been written down.

Why can't I print inside a function? It works in other Python software, doesn't it?

Such as below. When I run it, nothing prints.

x = 4
def odd(x):
print (x%2 !=0)

1 comment
Comment actions Permalink

Are you calling odd() after that?  Defining a function doesn't execute it unless you do so specifically.


Please sign in to leave a comment.