Why doesn't exit()
stop the script after the first iteration?
In my opinion, it has to stop after the first iteration.
>>> def func(q):
... def funct(y):
... try:
... print(y)
... exit()
... except:
... pass
... funct(q)
...
>>> a=['1','2','3','4','5','6','7']
>>> for x in a:
... func(x)
...
1
2
3
4
5
6
7
>>>