Chapter 12
Building Strings
Strings are useful for more than representing sentences and words. For exam-
ple, genetic information is usually represented by character strings.
DNA is a double helix of two chains of nucleotides. Each nucleotide base can
be represented by a single letter, and so a chain of nucleotides can be thought
of as a string. Even though DNA has two chains (also called strands), the two
are closely related: given one, it is easy to calculate the other. Thus, DNA
is generally described by one string of characters representing the nucleotide
bases of one of its strands.
The four bases that make up DNA are adenine (A), cytosine (C),
Get A Concise Introduction to Programming in Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.