-4
def compare(a,b):
if a == b:
return True
else:
return False
While(f == 0):
if(compare(newk1,k1)==True):
if(compare(newk2,k2)==True):
f=1
break
else:
f=0
else:
f = 0
k1 = newk1
k2 = newk2
エラー同じインデックスとpythonで二つのリストに一致する
File "C:\Users\..\Desktop\problem_solution.py", line 101, in <module> if(compare(newk1,k1)==True):
File "C:\Users\..\Desktop\problem_solution.py", line 25, in compare if a == b:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
範囲(0,3)に私のためのあなたの努力 – kuro
をご提示ください: I K1でnewk1と私であれば: newk1.index(I)==はk1.index(I)の場合: //ものを行います –
@ShreyGuptaコメントは編集していません。 – WhatsThePoint