Variable-length parameters and process

Variable-length parameters

         Length parameter is not defined

  • * Arge (position parameter passing) → returns a tuple

       Case:

           

  • ** kearge (with parameter name parameter passing) is returned dictionary →

       Case:

            

  • The two were together is really variable length parameter (* args must be placed in front of)

        Case:

            

 

             

Function generator:

       Case:

           

  •  Try to execute the code in the try, if wrong, were captured expect, but the entire program does not crash, the code is as follows:

            

Processes and threads:

  Process: is a program running on the system, the program is run once the process. Simply put, every time can only run one program to the next after a completion.

  Case:

               

  Thread : A process can also have multiple concurrent thread of execution, simply means that you can get with multiple CPU scheduling the execution unit, which is called a thread. Simply means that you can be more than one program at the same time.

   Case:

                

 

Guess you like

Origin www.cnblogs.com/star6/p/11329412.html