Question: Expected Behavior Write a function grid _ is _ square ( arglist ) , where arglist is a list of lists, that returns True if

Expected Behavior
Write a function grid_is_square(arglist), where arglist is a list of lists, that returns True if arglist has the shape of a square grid, i.e., if the length of each element (i.e., "row") of arglist is equal to the number of rows of arglist; and False otherwise.
You can assume that arglist is a list of lists, and do not have to check this.
Examples
grid_is_square([[1,2],[3,4]])
return value: True
grid_is_square([[0,1,2],[3,4]])
return value: False
grid_is_square([[0,1,2,3,4],[3,4,5,6,7],[4,5,6,7,8]])
return value: False
grid_is_square([[1]])
return value: True
grid_is_square([[1,2,3],[3,4,5],[5,6,7]])
return value: True

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!