performance - Iterating bidimensional array/list with only one for (Python) -


this question has answer here:

instead of doing this:

for x in range(500):     y in range(300):         print x,y 

how can this?

for x,y in range(500),range(300):     print x,y 

i use itertools.product

from itertools import product x, y in product(range(500), range(300)):     print x, y 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -