Define a function named get_unique_sorted (list1, list2) that takes two integer lists as parameters. The function combin
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Define a function named get_unique_sorted (list1, list2) that takes two integer lists as parameters. The function combin
Define a function named get_unique_sorted (list1, list2) that takes two integer lists as parameters. The function combines the values from the two parameter lists and produces a new list that is sorted and contains no duplicates. For example: Test Result list1 [3, 5, 1, -4, 2] [3, 5, 1, -4, 2] [1, 7, -2, 6, 9] [-4, -2, 1, 2, 3, 5, 6, 7, 9] list2= [1, 7, -2, 6, 9] list3 = get_unique_sorted (list1, list2) print (list1, list2, list3) list1 [13, -5, 14] [13, -5, 14] [38, 14, -2] [-5, -2, 13, 14, 38] list2 [38, 14, -2] list3 = get_unique_sorted (list1, list2) print (list1, list2, list3)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!