warming up your workspace

Python Foundations through Bioinformatics

Never written code before? Start here. You will learn the absolute basics of Python, output, variables, types, decisions, loops, and functions, using DNA bases, sequences, codons, and GC content as your playground. By the end you are ready for Project 1.

First words

  1. Display your first message
  2. Display numbers in order
  3. Explain your code with comments
  4. Display a DNA base name and symbol
  5. Calculate the GC fraction

Remembering things

  1. Store a gene length in a variable
  2. Update a stored sequence length
  3. Choose numbers, text and Boolean values
  4. Convert a text percentage to an integer
  5. Use clear names for a genome summary

Making choices

  1. Compare GC content with a threshold
  2. Display a message when a condition holds
  3. Choose a message with if and else
  4. Select a GC band with elif
  5. Require two conditions with and

Doing it again

  1. Repeat a countdown with while
  2. Visit numbered positions with for and range
  3. Build a running total of base counts
  4. Leave a loop early with break
  5. Visit combinations with nested loops

Many values and reuse

  1. Store and read a list of GC fractions
  2. Find the highest GC fraction in a list
  3. Define a function that returns a GC fraction
  4. Return the complement of a DNA base
  5. Capstone: report the highest GC fraction and its band

Explore the full field