当前位置:网站首页>4.ypthon function foundation

4.ypthon function foundation

2022-06-25 20:04:00 Iron plate jumping to the bottom

1. Explain the usage of various parameters of some functions ?

The parameters of the function are divided into : Formal parameters and actual parameters
Shape parameter

  Positional arguments 	
 	 A similar variable is used to store the value passed from the actual parameter of the corresponding position 
 	
  Default parameters  
 	 Used for keyword parameters with multiple common attributes and values in the arguments  
 	
  Indefinite length parameter 
 	*args
 	 Used to receive position parameters of unknown length 
 	**kwargs
 	 Keyword parameter for receiving position length 

Actual parameters

 Positional arguments 
	 One or more , Comma separated arguments 
 Key parameters 
	 One or more with Key  and  Value  Dictionary type parameter for 

2. For functions return What is it? ?

 For functions ,return It is a value that indicates the end of the function and returns a result to the outside 
原网站

版权声明
本文为[Iron plate jumping to the bottom]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202190508572727.html