Name: __________________________ NetID: _____________ Name: __________________________ NetID: _____________ Name: __________________________ NetID: _____________
strand = 'cgcgcgaaattt' length = len(strand) xx = [1 for ch in strand] yy = [ch+ch for ch in strand] zz = [3 for silly in strand] print xx print sum(xx) print yy print zz print sum([1 for ch in strand if ch =='g' or ch == 'c']) output:
def joinTogether(mylist, separator): # TODO: convert the list mylist into a string of items from # mylist separated by separator return "replace me"
def processLine(line): words = line.split() # put the words into a list # TODO: Given a string of words, create a new string from those # words keeping only the words whose length is greater than 4 return "replace me"