Simple question about slicing and for loops without indices
If I was making this loop:
for i in range(len(array)):
for j in range(len(array)+1):
# some code using array[i] and array[j]
Would there be a way to do the same thing in this format?
for element in array:
for next_element in array:
# some code using element and next_element
Or would I just be better off using the i, j
format?
from Recent Questions - Stack Overflow https://ift.tt/34Uz0dB
https://ift.tt/eA8V8J
Comments
Post a Comment