I have a function when I use it outside the class as a function it works perfectly but when I want to use I as a method in a class I get a TypeError massage :
Traceback (most recent call last):
File "H:\python\prototyp_01.py", line 122, in <module>
manupacians.koor(z)
File "H:\python\prototyp_01.py", line 58, in koor
if manupacians.ordna(z)== z:
File "H:\python\prototyp_01.py", line 45, in ordna
new_j = j-1
TypeError: unsupported operand type(s) for -: 'list' and 'int'
My function
def ordna(self,x):
b = 0
y = []
for j in x:
new_j = j-1
if new_j<0:
del new_j
else:
y.append(new_j)
b+=1
y.append (b)
y.sort()
y.reverse ()
return y
Any suggestions? Thanks