admin管理员组文章数量:1612831
As mentioned in the previous chapter, some data structures are shared between
different computer languages, but some of them are language specific. That is why
data types somehow define a computer language. Python has its own characteristic
data types.
One such fundamental data structure is a sequence. Inside a sequence, the elements have a sequential order. For example the string, which is an ordered sequence of characters. Other sequences are lists and tuples.1 Although fundamental
differences exist between these types of sequences, they share common properties.
Sequence elements have an order, can be indexed, can be sliced, and can be iterated.
Don’t worry if you don’t understand some of these terms. Just keep on reading.
We’ll see all these points during this chapter.
Apart from sequences, there are also unordered data types: dictionaries and sets. A dictionary2
stores relationships between a key and a value, while a set is just an
unordered collection of values. The next pages are focused on ordered (string, list,
and tuple) and unordered types (dictionary and set).
3.1 STRINGS
A string is a sequence of symbols delimited by a single quote (’), double quotes
("), triple single quotes (”’), or triple double quotes ("""). Therefore, the following
strings are equivalent:
"This is a string in Python"
’This is a string in Python’
’’’This is a string in Python’’’
"""This is a string in Python"""
本文标签: fundamentalPythonstructurepythonPDFBioinformatics
版权声明:本文标题:python fundamental structure_Python for BioinformaticsPDF 下载 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1728643390a1167395.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论