After defing trainsvm , when i run it i get an empty list

i get an empty list , when i run the train svm function

def trainsvm(x,y):
svm_classifiers={}

for i in range(classes):
    svm_classifiers[i]={}
for j in range(i+1,classes):
    xpair,ypair= getdatapairforsvm(data[i],data[j])
    wts,b,loss=mysvm.fit(xpair,ypair)
    svm_classifiers[i][j]=(wts,b)
return svm_classifiers   

svm_classifiers= trainsvm(img_data,labels)

svm_classifiers

output-{0: {}, 1: {}, 2: {}, 3: {}}

Hey , I guess the indentation of your code is not correct. Can you please share the screenshot of the code once again ?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.