[Baypiggies] string to list question

Brian Rue brian at lolapps.com
Thu Aug 5 06:51:31 CEST 2010


Why didn't you say so? :) Looks like Zach's code will do the trick.

On Wed, Aug 4, 2010 at 9:48 PM, Vikram K <kpguy1975 at gmail.com> wrote:

>
> I am afraid i was looking for a more general solution. Let's say the string
> is:
> z = 'AT/CGACATACG/C'
>  and i want
> zlist = ['A','T/C','G','A','C','A','T','A','C','G/C']
>
>
> On Thu, Aug 5, 2010 at 10:13 AM, Brian Rue <brian at lolapps.com> wrote:
>
>> Naive solution:
>>
>> zlist = [z[0], z[1:4], z[4]]
>>
>> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K <kpguy1975 at gmail.com> wrote:
>>
>>> Suppose i have this string:
>>> z = 'AT/CG'
>>>
>>> How do i get this list:
>>>
>>> zlist = ['A','T/C','G']
>>>
>>>
>>> _______________________________________________
>>> Baypiggies mailing list
>>> Baypiggies at python.org
>>> To change your subscription options or unsubscribe:
>>> http://mail.python.org/mailman/listinfo/baypiggies
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100804/e1d85a2f/attachment.html>


More information about the Baypiggies mailing list