Question: Write a function, called all _ pairs, that takes two lists as paramters, x and y , # and returns a new list containing all

Write a function, called all_pairs, that takes two lists as paramters, x and
y,
# and returns a new list containing all possible pairs consisting of one element
from
# x and one element from y as long as they are not the same. Cannot use built-in
# functions or sets.
# For example: If the list x =[1,4,6,8] and y =[5,2,6] then the result is
the list
# [(1,5),(1,2),(1,6),(4,5),(4,2),(4,6),(6,5),(6,2),(8,5),(8,2),
(8,6)].
# Note that (6,6) doesn't appear because they are the same element.
# (10 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!