In [23]: L = [1, 2, 3, [], 4, 5]
In [24]: for i in L:
...: print(1+i)
...:
2
3
4
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[24], line 2
1 for i in L:
----> 2 print(1+i)
TypeError: unsupported operand type(s) for +: 'int' and 'list'
In [25]: try:
...: for i in L:
...: print(1+i)
...: except:
...: pass
...:
2
3
4
In [26]: for i in L: