functions and branching and we also used functions that were bound to specific objectsand accessed with the dot syntaxfor instanceappend to add elements to listc [ append( this last type of function is quite specialsince it is bound to an objectand operates directly on that object ( append changes cthese bound functions are also referred to as methodsand will be considered in more detail in in the present we will primarily consider regularunboundfunctions in pythonsuch functions provide easy access to already existing program code written by others ( sin( )there is plenty of such code in pythonand nearly all programs involve importing one or more modules and using pre-defined functions from them one advantage of functions is that we can use them without knowing anything about how they are implemented all we need to know is what goes in and what comes outand the function can thus be used as black box functions also provide way of reusing code we have written ourselveseither in previous projects or as part of the current codeand this is the main focus of this functions let us delegate responsibilities and split program into smaller taskswhich is essential for solving all problems of some complexity as we shall see later in this splitting program into smaller functions is also convenient for testing and verifying that program works as it should we can write small pieces of code that test individual functions and ensure that they work correctly before putting the functions together into complete program if such tests are done properlywe can have some confidence that our main program works as expected we will return to this topic towards the end of the so how do we write function in pythonstarting with simple exampleconsider the previously considered mathematical function (np ( / ) for given values and we can implement this in python as followsdef amount( ) return *( + / )** these two lines of code are very similar to the examples from but they contain few new concepts that are worth noting starting with the first linedef amount( )is called the function headerand defines the function' interface all function definitions in python start with the word defwhich is simply how we tell python that the following code defines function after def comes the name of the functionfollowed by parentheses containing