TypeError; Must use key word argument or key function in python 3.x

Looks like the problem is in this line.

self.__working_arr[num].sort( key = lambda a,b: cmp(a.weights, b.weights) )

The key callable should take only one argument. Try:

self.__working_arr[num].sort(key = lambda a: a.weights)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)