ShareChat
click to see wallet page
search
#python convert nested list into normal list using def function
python - Programiz | Trogramiz Programiz PRO Programiz PRO Python Online Compiler| Python Online Compiler| : 0 main py min py ஃ Output Output 1  def flatten_list(nested) : [1, 2, 3, 4, 5] flat=[] for in nested: Code Execution Successful if isinstanceli,list): flat extend(flatten_list(i] )) else: flat.append(i) return(flat) 5]]]]| 10 nested [१ , [3, [2, [4, print(flatten_list(nested) ) 11 Programiz | Trogramiz Programiz PRO Programiz PRO Python Online Compiler| Python Online Compiler| : 0 main py min py ஃ Output Output 1  def flatten_list(nested) : [1, 2, 3, 4, 5] flat=[] for in nested: Code Execution Successful if isinstanceli,list): flat extend(flatten_list(i] )) else: flat.append(i) return(flat) 5]]]]| 10 nested [१ , [3, [2, [4, print(flatten_list(nested) ) 11 - ShareChat