1.**name是以dict存在的哦~~ >>> def cheeseshop(kind,*arguments,**keywords): print("---Do you have any",kind,'?') print("--I'm sorry we'are all out of",kind) for arg in arguments: print(arg) print("_"*40) keys=sorted(keywords.keys()) for kw in keys: print(kw,":",keywords[kw]) >>> cheeseshop("Limburger","its funny","really funny",shopkeeper="Mic",client="Tom",sketch="Tim") ---Do you have any Limburger ? --I'm sorry we'are all out of Limburger its funny really funny ________________________________________ client : Tom shopkeeper : Mic sketch : Tim >>> 2.*和**,用以解引用 >>> args=[3,6] >>> list(range(*args)) [3, 4, 5] >>> def parrot(voltage,state='a stiff',action='voom'): print("---This parrot woudn't",action,end=' ') print("if you put",voltage,"volts through it.",end=' ') print("E's",state,"!") >>> d={"voltage":"four million","state":"bleedin","action":"VOOM"} >>> parrot(**d) ---This parrot woudn't VOOM if you put four million volts through it. E's bleedin ! >>> 3.Lamda >>> def make_incr(n): return lambda x:x+n >>> f=make_incr(42) >>> f(0) 42 >>> f(56) 98 >>>