1.函式呼叫函式
def fun1(x): print('......................') x() def fun2(): print('**********************') fun1(fun2) #將fun2換為x,x()就相當於fun2(),即呼叫fun2
2.列表也可以append列表
>>> b = [1,2,3,4] >>> c = [5,6,7] >>> c.append(b) >>> c [5, 6, 7, [1, 2, 3, 4]] >>>
def fun1(x): print('......................') x() def fun2(): print('**********************') fun1(fun2) #將fun2換為x,x()就相當於fun2(),即呼叫fun2
>>> b = [1,2,3,4] >>> c = [5,6,7] >>> c.append(b) >>> c [5, 6, 7, [1, 2, 3, 4]] >>>