如果我有 List<String> text
我怎麼能在特定的範圍內,例如創建所有continious元素的子列表 List<String> subList = /* all elements within text bar the first 2*/
此外,還有沒有其他有用的列表操作提示&技巧可能是有用的?
有一條巨蟒內置的是不一樣的tupler一組列表,或類似的東西: def tupler(arg1, *args):
length = min([len(arg1)]+[len(x) for x in args])
out = []
for i in range(length):
out.append(tuple([x[i] for x in [arg1]+a
我試圖完成這個練習; Write a Lisp function that takes as input a list of elements, such as (A B C)
,並返回,其中每個元素的位置跟隨它的列表,如(A 1 B 2 -C 3) 我試圖與兩個函數來做到這一點,但它不能正常工作,我只是得到相同的列表。這裏是我的代碼: (defun insert (index var use