Use the phrase set(tuple(x) for x in my_list) to loop over all inner lists in a generator expression provided into the set() function and convert each one to a tuple using the built-in function tuple() to convert a nested my_list to a set in Python.