Question: python keep getting none for output also would u explain the other def function implementation? 2 EA[ ## # Define a function that takes in
python

keep getting none for output also would u explain the other def function implementation?

2 EA[ ## # Define a function that takes in two sets and returns their Cartesian product # The result should be represented as a list of tuples, ex: [(1, 1), (1, 2), ] def cartesian_product(A, B): # Provide your code here # Testing the cartesian-product function print "[1] x B -, cartesian_product([1], B) print-[1, 2] x B =-, cartesian_product([1, 2], B) print-[] x B =-, cartesian_product([], B) # Expected: print # Define a function that takes in a set and returns its power set # The result should be represented as a list of lists, ex: tt, till t2. def power set(A): # Provide your code here # Testing the power-set function print "P(I1, 2, 3]) -, power_set([1, 2, 3]) print "P(I]) , power set([]) # Expected: #PL[1, 2, 3])- [[], [1], [2], [1, 2], [3], [1,3], [2, 3], [1, 2, 3]] Filter. Eg: text,"rts,!"n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
