ABSTRACT

Python has its own characteristic data types. One such fundamental data structure is a sequence. Inside a sequence, the elements have a sequential order. Other sequences are lists and tuples. Apart from sequences, there are also unordered data types: dictionaries and sets. This chapter presents an example for string that represents an amino-acid sequence and it is called signal_peptide. Lists are one of the most versatile object types in Python. Any Python function or method can be used to define a list by comprehension. Unlike strings, lists can be modified by adding, removing, or changing their elements. The most common uses of sets are membership testing, duplicate removal, and the application of mathematical operations: intersections, unions, differences, and symmetrical differences. A difference is the resulting set of elements that belongs to one set but not to the other. Sets share some properties with sequences, such as max, min, len, in, etc. Frozenset is the immutable version of set.