"NameError: name 'quicksort' is not defined " << But why?

class sort():
def init(self, arr,lenn):
self.arr = [int(i) for i in arr]
self.lenn = lenn
def qicksort(self):
if len(self.arr)<=1:
return self.arr
pivot = self.arr[self.lenn//2]
left = [x for x in self.arr if x<pivot]
middle = [ x for x in self.arr if x==pivot]
right = [x for x in self.arr if x>pivot]
return quicksort(left)+middle+quicksort(right)
N = int(input())
D = input().split()
sol = sort(D,N)

hey @snehill090 ,
its just typo.

You have named function as qicksort
but calling it as quicksort

so just correct it.

1 Like

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.

1 Like

It was typo :sweat_smile::sweat_smile:…btw thanks :slight_smile:

hey @snehill090 ,
kindly mark this doubt as resolved in your course’s doubt section and do provide you feedback.

Thank You and Happy Learning :slight_smile:.