You come back too fast:
from random import choice
def String(length):
DNA=""
for count in range(length):
DNA+=choice("CGTA")
return DNA
return for, - return.
Python return:
" return ( None) ."
, return :
def String(length):
DNA=""
for count in range(length):
DNA+=choice("CGTA")
return DNA
EDIT: ( , ).
def weightedchoice(items):
return choice("".join(x * y for x, y in items))
weightedchoice choice :
DNA+=weightedchoice([("C", 10], ("G", 20), ("A", 40"), ("T", 30)])