Solution to challenge #2

a = raw_input("Type something: ")
print a

Back to the lesson


Solution to challenge #4

One possible solution

dna = 'AGCTTCGA'

print dna.count('A')
print dna.count('C')
print dna.count('T')
print dna.count('G')

another possible solution:

dna = 'AGCTTCGA'
elem =  dna.count ('A')
print  elem
elem =  dna.count ('C')
print  elem
elem =  dna.count ('T')
print  elem
elem =  dna.count ('G')
print  elem

Back to the lesson


Back

Back to main page.