1.python-----definition and parameters of tunctions
2. the parameter when defining a function is called a parameter, and the value passed in when using a function is an actual parameters(here are some values passed in)
python-----definition and parameters of tunctions
3. functions output some data
python-----definition and parameters of tunctions
python-----definition and parameters of tunctions
5.the variablles inside the function are ‘local’, which only work inside the function, while the variables outside the function are defined as ‘global’. when the global is not declared inside the functtion ,the global variables do not work inside the function
python-----definition and parameters of tunctions
4. python’s own definition is bulit-in

  1. nested functions in a function,
  2. then the variables in the outemost function are called enclousure if the variables in the outmost function are called in a subfunction then ’ nonlocal ’ is added to the definition
    python-----definition and parameters of tunctions
    python-----definition and parameters of tunctions
    7.summary
    python-----definition and parameters of tunctions
  3. the immutable type has int , float tuple ,string
    variable types include dictionaries and lists

python-----definition and parameters of tunctions
python-----definition and parameters of tunctions
python-----definition and parameters of tunctions
8. if the data passed in by the function is a copy,it will not affect the original data

python-----definition and parameters of tunctions
python-----definition and parameters of tunctions

相关文章: