Re: [問題] list排序的問題
最簡單的作法就是用list index
data_index = 0
data_step = 5
for i, d in enumerate(day):
print(' '.join([d,
' '.join(data[data_index:data_index + data_step]),
time[i],
]))
data_index += data_step
※ 引述《aety0129 (Chen)》之銘言:
: 想請問一下, 我現在有幾個列表大概長這樣
: data = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
: day = [one, two, three, four]
: time = [a, b, c, d]
: 我要怎麼做可以這樣呈現呢?
: one 1 2 3 4 5 a
: tow 6 7 8 9 10 b
: three 11 12 13 14 15 c
: four 16 17 18 19 20 d
: 讓他可以跟著我要的順序跑
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.28.171
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Python 近期熱門文章
PTT數位生活區 即時熱門文章