Skip to content

Commit

Permalink
Merge pull request #647 from Aakash1822/patch-2
Browse files Browse the repository at this point in the history
Update CODE2RACE/ASSIGNMENTS/CompareList
  • Loading branch information
TANIYA GUPTA authored Oct 29, 2018
2 parents 06f35e7 + ba5869f commit fb8d869
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ASSIGNMENTS/CompareLists
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Write a Python program to compare two unordered lists (not sets).

The program are:

from collections import Counter
def compare_lists(x, y):
return Counter(x) == Counter(y)
n1 = [20, 10, 30, 10, 20, 30]
n2 = [30, 20, 10, 30, 20, 50]
print(compare_lists(n1, n2))

0 comments on commit fb8d869

Please sign in to comment.