Python基礎之函數參數

一、實參   1、實參分類:       2、實參基礎代碼:    def fun01(a, b, c): print(a) print(b) print(c) # 位置傳參:實參與形參的位置依次對應 fun01(1, 2, 3) # 序列傳參:用*將序列拆分後與形參的位置依次對應 fun01(*[4, 5, 6]) # 關鍵字傳參:實參根據形參的名稱進行對應 fun
相關文章
相關標籤/搜索