hello I am searching for this solution but couldn't find any
I want to convert below list
list1=[1,2,3,[4],5,[2,4]]
output=[1,2,3,4,5,2,4]
U got it with this code
list1=[1,2,3,[4],5,[2,4]]
list2=[]
for i in range(len(list1)):
if type(list1[i])!=int:
for j in range(len(list1[i])):
list2.append(list1[i][j])
else:
list2.append(list1[i])
print(list2)
Can anyone tell any other way to this without for loops and all