7367network

List Comparer

Nov 19th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. first_list = [1, 2, 3, 4] (is fixed, 4 elements which don't change)
  2. second_list - [1, 2, 3, 4] (the elements can change, but always has 4 elements)
  3.  
  4. def compare_lists(first_list, second_list):
  5. if first_list == second_list:
  6. print("Elements 1, 2, 3 and 4 are all identical and in the same order.") #Outcome 1
  7. else:
  8. #Check each of the four numbers in both lists for outcomes 2 and 3
Advertisement
Add Comment
Please, Sign In to add comment