Exploring Bioinformatics with Python
Basic:
[Skip To Body]
[Front Door]
|
[Reference]
[Labs]
[Projects]
Courses:
[BIO/CSC295.01 2009F]
Python:
[python.org]
[biopython.org]
Misc:
[Exploring Bioinformatics site]
Given a list or a string, it is easy to extract just part of the list or part of the string.
seq[start:after] extracts all the elements
starting at position start and finishing immediately before
position after.
seq[start:] extracts all the elements starting
at position start and finishing at the end of the list/string.
seq[:n] extracts all the elements before
position n. That is, it gives you the first n elements
of the sequence.
There are many other ways to extract sublists and substrings, but these are the ones you'll need the most.
This page was generated by
Siteweaver on Thu Sep 10 12:55:27 2009.
The source to the page was last modified on Thu Sep 10 12:55:26 2009.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/ExBioPy/sublist-substring.html.
You may wish to validate this page's HTML
Samuel A. Rebelsky