Python: a recursive list

Yili Shih
Nov 15, 2021

--

# 基本主題: 巢狀式 nested list列表, append語法, index 冒號或尾巴-1等變化用法

# 變化題: 將自己(list) append 到自己 叫做 self-referencing list 自我參照的(recursive 遞迴式)list

# What happens when you append a list to itself
# By appending a list to itself, you create a self-referencing list.
# This is denoted by the ellipsis ([…]). 省略表示法
# It’s like a recursive function (without a break condition). 好比是一個遞迴式的函數

#許多範例網站的list操作 實在太簡單了,這題有點複雜
#這樣的題目沒有實際跑,使用工人智慧實在很容易錯吧~

Reference
https://www.sololearn.com/Discuss/1856497/python-append-a-list-to-the-same-list
https://stackoverflow.com/questions/17160162/what-do-ellipsis-mean-in-a-list

--

--

No responses yet