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)
请先登录再写评论。
Are you calling odd() after that? Defining a function doesn't execute it unless you do so specifically.