Reputation: 13705
I have the following function in 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
When I run the file in ipython, I get the following error:
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'
Why am I getting that error?
Upvotes: 0
Views: 1041
Reputation: 251383
Your build_solution
function is, at some point, returning None
. Since you set solution
to the return of this function, you are setting it to None.
I can't be more specific unless you show the code for build_solution
.
Upvotes: 8