1.斐波那契数列 http://pythontutor.com/visualize.html#code=def%20fib%28n%29%3A%0A%20%20%20%20result%3D%5B1,1%5D%0A%20%20%20%20for%20i%20in%20range%28n-2%29%3A%0A%20%20%20%20%20%20%20%20result.append%28result%5B-2%5D%2Bresult%5B-1%5D%29%0A%20%20%20%20return%20result%0Aprint%28fib%285%29%29&cumulative=false&curInstr=13&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false 2.默认参数值在函数对象被创建时计算 http://pythontutor.com/visualize.html#code=def%20init%28arg,result%3D%5B%5D%29%3A%0A%20%20%20%20result.append%28arg%29%0A%20%20%20%20print%28result%29%0Ainit%28'a'%29%0Ainit%28'b'%29%0Ainit%281,%5B1%5D%29&cumulative=false&curInstr=16&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false 3.数量可变参数 http://pythontutor.com/visualize.html#code=def%20countnum%28a,*b%29%3A%0A%20%20%20%20print%28b%29%0A%20%20%20%20print%28len%28b%29%2B1%29%0Acountnum%283,7,9%29%0Acountnum%285,8,1,6,89%29&cumulative=false&curInstr=10&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false 当函数参数数目不确定时,*将一组可变数量的位置参数集合成参数值的元组