← Lab 4

Functions — reusable tools

Write it once
  • ▸def gc_content(seq): … return answer
  • ▸Parameters feed it different inputs
  • ▸Defaults you can override: translate(seq, frame=0)
Compose & document
  • ▸Document it: type hints + a docstring
  • ▸Functions calling functions → an analysis
  • ▸Finale: is a mutation silent, or missense?
Python for Biologists