Beginner here. I am writing a basic algorithm that involves taking a list of x-values and a list of y-values and then storing all possible combinations of coordinates.
Here are the x and y value lists:
x_line = [6,5,9,3,7,5,9]
y_line = [10,3,5,7,1,7,3,1]
I would ideally want to store all possible coordinates in variable xy
because I will be comparing the coordinates in this variable to other sets of coordinates.
I tried to use zip() to do this but I am unsure if I can zip() iterators. Here is that code:
for i in x_line:
for j in y_line:
xy = zip(i,j)
This yields an "int object not iterable" error.
I tried even this:
xy = zip(x_line,y_line)
but obviously this does not get every possible combination.
Again, I want to store all possible coordinates given a list of x and y value lists in one variable. I would appreciate any help or guidance. Thanks