We're working on a simple code that represents the DNA sequence in Python.
Code that stores the base sequence in the list when it is entered, transforms the list element according to the rule with a for statement and an if statement, and outputs the changed list. (Rule: A --> T, T --> A)
But if I did it like I planned it, the for statement was executed, and I changed only a and I didn't touch a and a.
So even if I input ATA, the if statement is applied only to a and ['T', 'T', 'A'] is printed out like this. (If it is printed correctly according to the rule, it should be printed as ['T', 'A', 'T']) How do you apply the if statement to a, a and output it correctly according to the rule?python list
a.Index ("A") always tells you the first index. So only the first one will change. There are other problems with the code, but it is.
All you have to do is take the mapping rules that you want to convert and map them one by one. Let's write list compliance.
You can roughly do it like this.
© 2022 pinfo. All rights reserved.