How to get the first N elements of a list in Python? ... 2 result = [] index = 0 while index < N: result.append(mylist[index]) index += 1.
確定! 回上一頁