For those unfamiliar a DNA sequence can be made up of four "letters": A,G,C,T. Example DNA sequence: ACGTTCCGTACGTACTCT
I am really new to this all and I would like some advice on how to go about this and how to learn python in general (rely on tutorials, do random projects, etc).
I am currently using someone else's program for my DNA sequence project and then I will go through line by line to see what's being done.
The first error I encountered when copying over the code was this:
- Code: Select all
>>> import random
>>> import sys
>>> def simulate_sequence (length) :
dna = ['A','G','C','T']
sequence = ''
for i in range (length) :
sequence += random.choice (dna)
>>> setsize = int (sys.argv)
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
setsize = int (sys.argv)
IndexError: list index out of range