【发布时间】:2014-02-16 14:52:25
【问题描述】:
当我尝试使用任何类型的列表运行此程序时,我得到一个 indexerror: 列表索引超出范围。
有什么想法吗?
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]
【问题讨论】:
-
你说的是哪种编程语言?
-
python 抱歉,感谢您的关注!
标签: python list python-3.x indexing