day 6 返回值,參數

1.函數返回值 In [3]: def divid(a,b): ...: shang = a//b ...: yushu = a%b ...: return shang,yushu ...: In [4]: sh, yu = divid(5,2) #元組方式返回 (2,1) In [5]: sh Out[5]: 2 In [6]
相關文章
相關標籤/搜索