I found an error in the code below:
xy=[3,5,[7,9,3,4],5,6]
flat=[]
for i in xy:
for j in i:
flat.append(j)
print(flat)
result is
TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_37548/2722898965.py in <module>
2 flat=[]
3 for i in xy:
----> 4 for j in i:
5 flat.append(j)
6
TypeError: 'int' object is not iterable
Please help me out