in python please
Posted: Sun May 15, 2022 12:29 pm
in python please
Complete the following function which converts a list to a set as exemplified by the tests at the end. # Purpose: Convert a given list L to a set. # For example, if L = (1,2,1), then ListaSet (L) returns (1,2). def List2Set (L): # Tests print (List2Set([1,2])) # print out (1,2) print (List2Set([1,2,1])) # print out (1,2)
Complete the following function which converts a list to a set as exemplified by the tests at the end. # Purpose: Convert a given list L to a set. # For example, if L = (1,2,1), then ListaSet (L) returns (1,2). def List2Set (L): # Tests print (List2Set([1,2])) # print out (1,2) print (List2Set([1,2,1])) # print out (1,2)