Study Notes (09): Python Interview 100 talking about (based Python3.x) - the role of single stars and binary operators, and examples ...

Learning immediately: https://edu.csdn.net/course/play/26755/340122?utm_source=blogtoedu

*: Introduced in the form of tuples, the number of arguments and can have a plurality of

def fun1(param1,*param2):

     print("param1:"param1)

     print("param1:"*param1)

fun1 (1,2,3) # (1,2,3) tuple

Output: param1: 1

           param2: 2,3

**: Importing a dictionary form

2, a list of the merger: the representative of a single star list

                  a.extend(b)

                  [*a, *b]

3, the merger dictionary: binary behalf dictionary

                  {**a,**b}

 

 

Published 26 original articles · won praise 2 · Views 288

Guess you like

Origin blog.csdn.net/qq_35504363/article/details/104251618