On my computer, this option gives the right answers
number = (-1, -2, -3, 0)
new_number=list(number)
number = (-1, -2, -3, 0)
new_number=list(number)
for x in range(len(new_number)):
for i in range(x,len(new_number)):
if abs(newnumber[x])>abs(newnumber[i]):
newnumber[x],newnumber[i]=newnumber[i],newnumber[x]
print(new_number)
on the site had to change the sign for a correct solution of the problem in a condition if. I change the sign on my computer and the numbers become, respectively, from largest to smallest. That does not match the correct solution.. Sorry for my bad English
passes the test code
def checkio(numbers_array):
newnumber = list(numbersarray)
for x in range(len(new_number)):
for i in range(len(new_number)):
if abs(newnumber[x])>abs(newnumber[i]):
newnumber[x],newnumber[i]=newnumber[i],newnumber[x]
return new_number
Created at: 2016/04/18 20:25; Updated at: 2016/04/18 21:10