python函數的參數

書寫一個函數 def  power(x):     return x * x 對於power(x)函數,參數x就是一個位置參數,當我們調用power(x)函數時,必須傳入有且僅有一個參數x power(5) power()也是內置函數,用法power(x,n)n爲指數,即多少個x相乘 默認參數 在定義函數時可以給定一個默認參數 def  enroll(name,gender,age=6,city=
相關文章
相關標籤/搜索