I am getting an indexerror: list index out of range when I try to run this program with any sort of list.
Any ideas?
def binaryListSort(aList):
'''takes a list of binary numbers and puts them in ascending order
inputs: a list of binary integers, aList Outputs: a new list with numbers
in ascending order.'''
if aList[0] == 0:
return aList[0] + binaryListSort(aList[1:])
else:
return binaryListSort(aList[1:]) + aList[0]