怎麼可以沒有recursion的解法呢!
https://glot.io/snippets/fwbt5ku840
def y(m=1):
def x(c=2):
if c > 9: return
print(f'{c} x {m} = {c*m}', end='\t') or x(c+1)
if m > 9: return
x() or print() or y(m+1)
y()
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.232.65.15 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1614599808.A.F64.html
※ 編輯: LP9527 (118.232.65.15 臺灣), 03/01/2021 20:44:53
推
03/02 01:28,
3年前
, 1F
03/02 01:28, 1F
→
03/02 01:29,
3年前
, 2F
03/02 01:29, 2F
推
03/02 01:42,
3年前
, 3F
03/02 01:42, 3F
→
03/02 01:43,
3年前
, 4F
03/02 01:43, 4F
→
03/02 01:48,
3年前
, 5F
03/02 01:48, 5F
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
心得
3
4