我要讓序言回到我給出的列表中的所有可能的子列表,所以我寫道: subSet(L,S):- append(_,L2,L),append(S,_,L2).
這樣一來我得到的結果一樣: Out = [] ;
Out = [a] ;
Out = [a, b] ;
Out = [a, b, c] ;
Out = [] ;
Out = [b] ;
Out = [b, c] ;
Out = [
我想創建一個對象列表,然後是一個子列表,然後刪除子列表中的所有元素,然後再次顯示主列表。但是,當我嘗試從子列表中刪除元素時,我在運行時indexoutofbounds和未知來源處出現錯誤。如何解決這個問題,使應用程序的作品? import java.util.*;
class Eval{
Eval(){
}
}
public class Ch11Ex7 {
給定一個二維列表,我想查找包含子列表的所有內容。我知道我可以做類似這樣的事情: #Psuedo-Python (not kosher)
def MatchAll(theList,toMatch):
result=list(theList)
for nMatch in toMatch:
for nResult in result:
if not nMa