用lamda做循環處理時,如果想在達到某種條件終止循環,那麼可以用anyMatch()方法:
anyMatch()返回的是一個Boolean結果,當return true時會跳出循環
以下是我代碼中的處理
用lamda做循環處理時,如果想在達到某種條件終止循環,那麼可以用anyMatch()方法:
anyMatch()返回的是一個Boolean結果,當return true時會跳出循環
以下是我代碼中的處理
def ADD(a): print(3,a,hex(id(a))) a.remove(2) print(3,a,hex(id(a))) a=a.append(10)