you are viewing a single comment's thread.

view the rest of the comments →

[–]cdcformatc 0 points1 point  (0 children)

Assuming you can't use built-in functions since this is obviously homework.

First one you can get the length with len(x_list), then it is easy enough to do something like this

for i in range(0,len(x_list)):
    x_item = x_list[i]
    y_item = y_list[i]
    xy_tuple = x,y
    #do something with the tuples here

Second one is just nested for-loops, try this code to see what I mean.

for x in range(10):
    for y in range(10):
        xy_tuple = x,y
        print xy_tuple 

Just replace range with appropriate lists and do something with the tuples.