Long time viewer, first time caller...
So in an effort to procrastinate instead of reading up for an exam I have been playing around in Pythons interactive shell and this happens:
Keep in mind that this is not supposed to be useful, or in fact used at all, but it seems odd that the "2" is left in "s" after the first run. Or am I missing some finer point?
>>> def poppop(s):
... for t in s:
... print t
... if type(t)==int:
['k', 'l', 2, 'k', 'l']
['k', 'l', 'k', 'l']
BTW: I was wondering if this is supposed to go in the programming/development subforum, but I posted it here instead since I didn't figure it would actually qualify as programming. If I am wrong please let me know...