Commit 12ce4521 authored by Lingling Jin (lij313)'s avatar Lingling Jin (lij313)
Browse files

update ex14

parent ec08bfe7
......@@ -9,7 +9,7 @@ SeqLength = len(DNASeq)
print ( "Sequence Length:", SeqLength )
BaseList = list(set(DNASeq))
BaseList = list(set(DNASeq))
for Base in BaseList:
Percent = 100 * DNASeq.count(Base) / SeqLength
print ( "%s: %4.1f%%" % (Base,Percent) )
#!/usr/bin/env python
## Revision of "compositioncalc2.py" from Ch 9 of Haddock & Dunn
## Converted from Python 2 to Python 3
## Make output of program more like that of "dnacalc.py"
DNASeq = "ATGTCTCATTCAAAGCA"
print ( 'Sequence:', DNASeq )
SeqLength = len(DNASeq)
print ( "Sequence Length:", SeqLength )
BaseList = set(DNASeq)
for Base in BaseList:
Percent = 100 * DNASeq.count(Base) / SeqLength
print ( "%s: %4.1f%%" % (Base,Percent) )
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment