VS code截圖 程式碼 space , slash , backslash , cr = ' ' , '/' , ' \\ ' , ' \n ' def row1 ( k , m ): #定義自訂函數 for i in range ( 1 , k + 1 ): for ii in range ( m ): for j in range ( k - i ): f . write ( space ) f . write ( slash ) for j in range ( 2 * i - 2 ): f . write ( space ) f . write ( backslash ) for j in range ( k - i ): f . write ( space ) f . write ( cr ) def row2 ( r , m ): for i in range ( 1 , k + 1 ): for ii in range ( m ): for j ...
def x(m,n): #定義自訂函數x newList = [] for i in m : #迴圈將m的元素每個都執行 newList.append(n(i)) return newList #傳回去 m=['貓','范雅惠','鴨子','你','他'] n=lambda y: y + '是聰明人' print(x(m,n)) for i in x(m,n): print(i) google機器學習實驗 https://colab.research.google.com/ 教學影片 張量Tensor計算 iframe=frame框
评论
发表评论