How to convert a nested list into a separate list?
rec = [["A",["B","C","D"]],["B",["D","E","F"]],["C",["G","H","I"]]]
Desired output:
desired_output = [["A","B","C","D"],["B","D","E","F"],["C","G","H","I"]]
I've tried the below code, however, it throws a Type Error: - unhashable type: 'list'
data = list(set([tuple(row) for row in rec]))
Any help would be greatly appreciated.
Thanks in advance.
question from:
https://stackoverflow.com/questions/65874146/converting-a-nested-list-into-list-shows-unhashable-type 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…