[Tutor] split a 5 chars word into 4 and 1
zstumgoren at gmail.com
Tue Mar 9 16:34:45 CET 2010
> I'm trying to split 5 chars words (codes) into 2 variables. The first must
> contain the first 4 characters. The second variable will only contain the
> last character. I'm working in a loop pre-generated codes.
> Any magic command for this ? :-)
> Examples of codes :
> Thanks a lot !
Hmm...This sounds a bit like homework. Can you show us any code that you've
already tried? Meantime, you might want to explore Python's slice syntax:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor