I'm running into a problem where it either replaces all Gs to Cs but doesn't replace the C to Gs, what can I do to fix this problem? the output im getting right now is "GUGAGGGGAG" the output im looking for is "CUCAGCGCAG" This is the code that I have till now:
a_string = "GAGTCGCGTC"
remove_characters = ["G", "A", "T", "C"]
ch1 = "G"
ch2 = "A"
ch3 = "T"
ch4 = "C"
a_string = a_string.replace (ch1, "C")
a_string = a_string.replace (ch2, "U")
a_string = a_string.replace (ch3, "A")
a_string = a_string.replace (ch4, "G")
print (a_string)
- I'm doing a DNA to RNA translation code! so A replaces to U, G to C, T to A and C to G