Question: Write a python function equal ( list 1 , list 2 ) that returns True if the two lists are the same. First, check that

Write a python functionequal(list1,list2)that returns True if the two lists are the same.
First, check that the length are the same. If not, the lists are not equal.
Second, sort both list and compare the list using==operator.
The following lists are equal.
[1,2,3] and [2,1,3]
[3,3,3] and [3,3,3]
[1,2,3] and [1,2,3]

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 Programming Questions!