All a function is, is a container that hold data and in the case of these function code as well. The data does nothing inherently so unless you tell the computer
'hey I want you to run code block 47' it will never do it unless you actually pass it the command to do so.
if data == None:
raise TypeError('No data entered')
print('You passed this function some data: %s' % data)
Now notice that when you run this codebit it does absolutely nothing at all. That is because we have failed to call any function or run code that is not in a function.
Once we add a function call to our function it will execute our code.
# OUTPUT: TypeError: No data entered
Ok, so we failed to give out function valid input, let's change it so that input is valid.
a_function('There is data here')
# OUTPUT: You passed this function some data: There is data here
It is easy to debug your code once you start, but remember that generally 80% of a coders time is spent debugging so do it right the first time. Take time to think about what you need done and go from there. That way you spend less time on debugging.
I also hope you realized by now that using functions is easy as pie, messing up functions is also easy.
So in closing, if you do not use your class/function or other encapsulated code it does nothing and just sits there.