Skip to content

Instantly share code, notes, and snippets.

@roman-on
Created April 21, 2020 00:15
Show Gist options
  • Save roman-on/477c40667a322cc2812eb9bc69cd487b to your computer and use it in GitHub Desktop.
Save roman-on/477c40667a322cc2812eb9bc69cd487b to your computer and use it in GitHub Desktop.
"""
The function receives two lists containing organs of the type int and float alone.
The function returns true if both lists contain exactly those people (even if in different order),
otherwise the function returns false.
Consider a built-in method / function for lists that will help you (repeat chapter 6.3 if necessary).
list1 = [0.6, 1, 2, 3]
list2 = [3, 2, 0.6, 1]
list3 = [9, 0, 5, 10.5]
are_lists_equal(list1, list2)
True
are_lists_equal(list1, list3)
False
"""
def are_lists_equal(list1, list2):
if sorted(list1) == sorted(list2):
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment