On Thu, Feb 11, 2010 at 12:12 AM, invincible patriot
<invincible_patr...@hotmail.com> wrote:

> thanks
> let me clear you that what i am trying to do
> suppose we hav a input string and a dict
> our_dict={'a':'u', 't':'a', 'c':'g', 'g':'c'}
> input_string='atcg'
>
>
> now what i wana do is that where ever we are having 'a' i wana replace it
> with 'u', 't' with 'a' and so on
> i tried using input_string.replace('a', 'u')
> but it is replacing only one character
> i wana replace these 4 characters according to the dictionary
>
> i hope it is now clear
>
> kindly let me know how to proceed now

See http://www.tutorialspoint.com/python/string_translate.htm

-- 
André Engels, andreeng...@gmail.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to