🧬 Lecture 1: Python Fundamentals

Interactive Google Colab notebooks to learn Python programming for biology. Work through these in order for the best learning experience.

🎯 Getting Started

New to Python? Start with the "Welcome to Google Colab" notebook below.

Each notebook is interactive - you can run code, make changes, and see results immediately.

No installation needed - everything runs in your web browser using Google Colab.

Start Here

🚀 Welcome to Google Colab

Your introduction to Jupyter notebooks and the Colab environment

  • What are notebooks and why use them?
  • Understanding cells (code vs text)
  • Running your first Python code
  • Common mistakes and solutions
  • Practice exercises
Open in Colab
Step 2

📦 Variables & Comments

Learn to store and organize your data with meaningful names

  • What are variables and why use them?
  • Python naming rules and conventions
  • Writing helpful comments
  • Variable assignment and updates
  • Biology examples and practice
Open in Colab
Step 3

🔢 Data Types

Understanding different kinds of data: numbers, text, and more

  • Integers for counting (cells, samples)
  • Floats for measurements (pH, concentrations)
  • Strings for text (gene names, sequences)
  • Booleans for true/false states
  • Type conversion and common errors
Open in Colab
Step 4

🎨 F-Strings & Formatting

Create beautiful, professional output for your biological data

  • Modern string formatting with f-strings
  • Controlling decimal places and precision
  • Scientific notation and percentages
  • Creating neat data tables
  • Lab report formatting
Open in Colab
Step 5

🔧 Functions: Reusable Code

Package your calculations into reusable building blocks

  • Why functions matter in programming
  • Creating your first function
  • Parameters and return values
  • Functions with and without returns
  • Default parameters and documentation
Open in Colab
Step 6

📋 Lists: Organizing Data

Store and organize multiple pieces of biological data

  • Creating and accessing lists
  • List indexing (starting from 0!)
  • Lists of lists for complex data
  • Adding and modifying list items
  • Real biological examples
Open in Colab
Step 7

🔄 For Loops: Automation

Automatically process multiple samples and datasets

  • Basic for loop syntax and concept
  • Processing lists with calculations
  • Combining functions and loops
  • Quality control automation
  • High-throughput data analysis
Open in Colab
Apply It!

🧪 Lab Calculator Toolkit

Real Python tools you'll actually use in the lab!

  • DNA/RNA dilution calculator
  • Molarity and molecular weight calculator
  • PCR master mix calculator
  • Protein yield calculator
  • Growth rate calculator
Open in Colab

💡 Learning Tips

Work through in order: Each notebook builds on the previous ones.

Take your time: Run every code cell and try the exercises.

Experiment: Change values and see what happens - you can't break anything!

Save your work: Use "File → Save a copy in Drive" to keep your progress.

🚀 Quick Access

📚 Part of the Python for Biologists course by Helfrid Hochegger

University of Sussex | Year 3 Biology, Biochemistry & Neuroscience