Question: 7) Define a function smartstack() that will take two 2D arrays of any size. It should: a) merge them horizontally if the arrays have the

 7) Define a function "smartstack()" that will take two 2D arrays

7) Define a function "smartstack()" that will take two 2D arrays of any size. It should: a) merge them horizontally if the arrays have the same number of rows or b) merge them vertically if the arrays have the same number of columns. Then return the bigger merged array. If both dimensions match, it can return either orientation. If there are no dimensions that share the same size, the function should raise an error (use Google to figure out how to make your function raise an error). Make sure to test out your function to see if it works

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!