## Shell Sort
def ShellSort(list):
distance = len(list) // 2
while distance > 0:
for i in range(distance, len(list)):
temp = list[i]
j = i
while j >= distance and list[j - distance] > temp:
list[j] = list[j - distance]
j = j - distance
list[j] = temp
distance = distance / 2
return list
Above is the code for 'Shell Sort' I typed after reading the algorithm book. But if I try to run it, Error occurs on 'for' statement that 'float' object cannot be interpreted as an integer. distance and len(list) are both int type, but I can't find what is the problem.