Program reasoning requires us to find the input for the function so that it outputs a certain result. The function is:
def func1(stuff, more_stuff=None):
data = []
for i, thing in enumerate(stuff):
if thing >= 0 or i < 2:
data.append(thing + i)
print(len(stuff))
if more_stuff is not None:
data += more_stuff
print(data)
And the expected output is:
4
[5, 3, 1, 5, -3]
The closest I can get it is:
4
[5, 3, 2, 5, -3]
with func1([5,2,0,2], [-3]) as input
I'm having trouble trying to get the the 1 and I'm just wanting to know how/why you can get a 1 as if it's anything less than 0 ie -1 as value for that index then 'thing' is < 0 and i = 2 so it skips that value/index and the output will be:
4
[5, 3, 5, -3]