Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(api): fix typo in loop examples #16997

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/docs/v2/new_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ When used in a protocol, loops automate repetitive steps such as aspirating and
# etc...
# range() starts at 0 and stops before 8, creating a range of 0-7
for i in range(8):
pipette.distribute(200, reservoir.wells()[i], plate.rows()[i])
pipette.distribute(20, reservoir.wells()[i], plate.rows()[i])

.. tab:: OT-2

Expand Down Expand Up @@ -315,7 +315,7 @@ When used in a protocol, loops automate repetitive steps such as aspirating and
# etc...
# range() starts at 0 and stops before 8, creating a range of 0-7
for i in range(8):
p300.distribute(200, reservoir.wells()[i], plate.rows()[i])
p300.distribute(20, reservoir.wells()[i], plate.rows()[i])

Notice here how Python's :py:class:`range` class (e.g., ``range(8)``) determines how many times the code loops. Also, in Python, a range of numbers is *exclusive* of the end value and counting starts at 0, not 1. For the Corning 96-well plate used here, this means well A1=0, B1=1, C1=2, and so on to the last well in the row, which is H1=7.

Expand Down