Im trying to flatten out the following list in python code. I keep running into an 'int is not iterable error' i know this is due to the list being both strings and ints. how do i account for this? sorry guys, first month of coding..... i know this is basic.
list_1 = [1,2,[3,[4,5],6],7,8,['hardware'],[['software'], 'interface']]
def flatten (list):
flat = []
for sublist in list_1:
for item in sublist:
flat.append(item)
print(flat)
return
flatten(list_1)