We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I don't get the idea of the three iter(s) refering to the same position in s (or do they?). They should refer to different positions in order to give the desired output.
You say
zip(*[iter(s)]*3)=zip(iter(s),iter(s),iter(s))
which is not true. The code (where s='abcdefghi'):
Merge the Tools!
You are viewing a single comment's thread. Return to all comments →
Sorry, but I couldn't get it. :(
I don't get the idea of the three iter(s) refering to the same position in s (or do they?). They should refer to different positions in order to give the desired output.
You say
which is not true. The code (where s='abcdefghi'):
gives output:
This output makes sense because each iter(s) refers to the same position in s for each iteration of the for loop.
Could you please clear my doubt?