expression)and methodname is the name of method that is defined by the object' type different types define different methods methods of different types may have the same name without causing ambiguity (it is possible to define your own object types and methodsusing classessee classesthe method append(shown in the example is defined for list objectsit adds new element at the end of the list in this example it is equivalent to result result [ ]but more efficient more on defining functions it is also possible to define functions with variable number of arguments there are three formswhich can be combined default argument values the most useful form is to specify default value for one or more arguments this creates function that can be called with fewer arguments than it is defined to allow for exampledef ask_ok(promptretries= reminder='please try again!')while trueok input(promptif ok in (' ''ye''yes')return true if ok in (' ''no''nop''nope')return false retries retries if retries raise valueerror('invalid user response'print(reminderthis function can be called in several waysgiving only the mandatory argumentask_ok('do you really want to quit?'giving one of the optional argumentsask_ok('ok to overwrite the file?' or even giving all argumentsask_ok('ok to overwrite the file?' 'come ononly yes or no!'this example also introduces the in keyword this tests whether or not sequence contains certain value the default values are evaluated at the point of function definition in the defining scopeso that def (arg= )print(argi (will print important warningthe default value is evaluated only once this makes difference when the default is mutable object such as listdictionaryor instances of most classes for examplethe following function accumulates the arguments passed to it on subsequent calls more control flow tools