Re: [問題] 語法改進

作者: alibuda174 (阿哩不達)   2014-10-11 20:36:35
不刪除的作法
x = [list(range(i)) for i in range(10, 0, -1)]
del x[3]
del x[6]
for i,d in enumerate(x):
print(d)
#
rst = []
for i in range(len(x[0])):
r = []
for j in range(len(x)):
try:
r.append(x[j][i])
except IndexError:
break
rst.append(r)
print('
作者: rockzerox (Zero)   2014-10-11 21:50:00
@@十分感謝您!!!

Links booklink

Contact Us: admin [ a t ] ucptt.com