#! /usr/bin/env python #import regular expression module import re #setting the DNA string myDNA = 'ACGTTGCAACGTTGCAACGTTGCA' #assigning a new regex and compiling it #to find all Ts regexp = re.compile('T') #create a new string tha will #receive the regex result with #Us replacing Ts myRNA = regexp.sub('U', myDNA) print myRNA