Python for Biologists
Lectures
Labs
Resources
Assessment
Schedule
About
GitHub →
← Lab 3
Loops —
do it to every value
The core patterns
▸
for count in spikes: — visit every value
▸
Accumulate: start at 0, add inside the loop
▸
Modify → append to a brand-new list
Level up
▸
enumerate → the index and the value together
▸
while + break — loop until a condition
▸
Comprehensions: the one-line, pythonic version
📓 01 · Loops — basics →
📓 02 · Loops — advanced →
← Previous
←
Next →
→
Python for Biologists