Question: Write a function a python that returns the cartesian product of these two lists list1: ['q1', 'q2', 'q3'] list2: ['t1','t2','t3'] def cartesian_product(list1,list2) return **The output
Write a function a python that returns the cartesian product of these two lists
list1: ['q1', 'q2', 'q3']
list2: ['t1','t2','t3']
def cartesian_product(list1,list2)
return
**The output when printed should look like this**
[(q1,t1),(q1,t2),(q1,t3),(q2,t1),(q2,t2),(q2,t3), (q3,t1),(q3,t2),(q3,t3)]
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
