#!/usr/bin/env python import random import sys #get sequence length from user input length = int(sys.argv[1]) #assign any DNA sequence to a string dnaseq = list('ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT') #print it print dnaseq #assign an empty string to receive the result result = '' #loop through the length for i in range(length): #here we use a random method that randonly picks a position #in the list result += random.choice(dnaseq) print result