lambda functions are expressionsso they can be created at their point of usehoweverthey are much more limited than normal functions methods are functions that are associated with particular data type and can be used only in conjunction with the data type--they are introduced in when we cover object-oriented programming python provides many built-in functionsand the standard library and thirdparty libraries add hundreds more (thousands if we count all the methods)so in many cases the function we want has already been written for this reasonit is always worth checking python' online documentation to see what is already available see the sidebar "online documentation( the general syntax for creating (global or localfunction isdef functionname(parameters)suite the parameters are optionaland if there is more than one they are written as sequence of comma-separated identifiersor as sequence of identifier=value pairs as we will discuss shortly for examplehere is function that calculates the area of triangle using heron' formuladef heron(abc) ( return math sqrt( ( ( ( )inside the functioneach parameteraband cis initialized with the corresponding value that was passed as an argument when the function is calledwe must supply all of the argumentsfor exampleheron( if we give too few or too many argumentsa typeerror exception will be raised when we do call like this we are said to be using positional argumentsbecause each argument passed is set as the value of the parameter in the corresponding position so in this casea is set to to and to when the function is called every function in python returns valuealthough it is perfectly acceptable (and commonto ignore the return value the return value is either single value or tuple of valuesand the values returned can be collectionsso there are no practical limitations on what we can return we can leave function at any point by using the return statement if we use return with no argumentsor if we don' have return statement at allthe function will return none (in we will cover the yield statement which can be used instead of return in certain kinds of functions some functions have parameters for which there can be sensible default for examplehere is function that counts the letters in stringdefaulting to the ascii letters