#%%
A = [0,1,2,3]
B = [4,5,6,7]
sum = 0
diff_sum = 0
for i in range(min(len(A), len(B))):
sum += A[i] + B[i]
diff_sum += A[i] - B[i]
#%%
print(sum)
2) Execute the first cell twice.
3) Execute the second cell.
4) Gather the second cell to a new notebook.
Expected: 2 cells
#%%
A = [0,1,2,3]
B = [4,5,6,7]
sum = 0
for i in range(min(len(A), len(B))):
sum += A[i] + B[i]
#%%
print(sum)
Actual: 3 cells
#%%
A = [0,1,2,3]
B = [4,5,6,7]
for i in range(min(len(A), len(B))):
#%%
A = [0,1,2,3]
B = [4,5,6,7]
sum = 0
for i in range(min(len(A), len(B))):
sum += A[i] + B[i]
#%%
print(sum)
The first cell is invalid Python code and shouldn't be included in the final gather.
To repro with gather extension:
1) Open a notebook with these two cells:
2) Execute the first cell twice. 3) Execute the second cell. 4) Gather the second cell to a new notebook.
Expected: 2 cells
Actual: 3 cells
The first cell is invalid Python code and shouldn't be included in the final gather.