in python please
Posted: Sun May 15, 2022 12:29 pm
in python please
Complete the following function which constructs a set containing all elements from a two given lists as exemplified by the tests at the end. # Purpose: Construct a set from two lists Li and L2. # For example, if L1 - [1,2] and L2 - [2,3] then union2lists (L1,L2) returns (1,2,3) def union2lists(L1,L2): # Tests print(union2lists([1,2], [2,3])) # print out (1,2,3) print(union2lists([1,2,3], ["h"])) # print out (1,2,3,"A"}
Complete the following function which constructs a set containing all elements from a two given lists as exemplified by the tests at the end. # Purpose: Construct a set from two lists Li and L2. # For example, if L1 - [1,2] and L2 - [2,3] then union2lists (L1,L2) returns (1,2,3) def union2lists(L1,L2): # Tests print(union2lists([1,2], [2,3])) # print out (1,2,3) print(union2lists([1,2,3], ["h"])) # print out (1,2,3,"A"}