我在python中有以下功能:
def find_str(s, m):
starting_points = find_starting_points(s,m)
solution = []
for i in range(0, len(starting_points)):
position = starting_points[i]
solution.append([position])
solution = build_solution(position, s, m, solution)
return solution
pass
当我在 ipython 中运行该文件时,出现以下错误:
55 for i in range(0, len(starting_points)):
56 position = starting_points[i]
---> 57 solution.append([position])
58 solution = build_solution(position, s, m, solution)
59 return solution
AttributeError: 'NoneType' object has no attribute 'append'
为什么我会收到这个错误?