You can define a function anywhere in your code. When you first start with Python this generally means defining functions within a module, i.e. at the “top level”. However, there is nothing wrong with ...