Module 3
Module challenge
Putting loops to work.
Count all bases
Write a program that loops through a DNA sequence and counts how many times each base (A, T, G, C) appears. Print the counts.
Your task
Count all bases
- Loop through a DNA sequence and count A, T, G, C. Print each count.
Remember
• Use for loops to repeat actions • Use range() for numeric loops • Loop through strings and DNA • Use while, break, and continue • Accumulate values in a loop