<div><font face="arial, helvetica, sans-serif">@Emile,</font></div><div><font face="arial, helvetica, sans-serif">I feel a little stupid, in my mind it was more difficult than in reality.</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif"><div>x = 'apple'</div><div>for f in range(len(x)-1):</div><div> print(x[f:f+2])</div><div><br></div><div>@Ian,</div><div>Thanks for that I was just looking in to that. I wonder which is faster I have a large set of strings to process. I'll try some timings if I get a chance later today.</div>
<div><br></div><div><br></div><div>Thanks again!</div></font></div><div>Vincent</div><br><br>
<br><br><div class="gmail_quote">On Mon, Oct 22, 2012 at 12:45 AM, Emile van Sebille <span dir="ltr"><<a href="mailto:emile@fenx.com" target="_blank">emile@fenx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 10/21/2012 11:33 AM, Vincent Davis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am looking for a good way to get every pair from a string. For example,<br>
input:<br>
x = 'apple'<br>
output<br>
'ap'<br>
'pp'<br>
'pl'<br>
'le'<br>
<br>
I am not seeing a obvious way to do this without multiple for loops, but<br>
maybe there is not :-)<br>
In the end I am going to what to get triples, quads....... also.<br>
<br>
</blockquote>
<br></div></div>
How far have you gotten? Show us the loops you're trying now and any errors you're getting.<span class="HOEnZb"><font color="#888888"><br>
<br>
Emile<br>
<br>
<br>
<br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br>