Docsity

Data Types in python, Lecture notes of Computational Biology

Partial preview of the text

Download Data Types in python and more Lecture notes Computational Biology in PDF only on Docsity!

full_spectrum_bioinformatics (/github/zaneveld/full_spectrum_bioinformatics/tree/master) / content (/github/zaneveld/full_spectrum_bioinformatics/tree/master/content) / 04_exploring_python (/github/zaneveld/full_spectrum_bioinformatics/tree/master/content/04_exploring_python) Python Data Types Quick Reference What's in this section? This section provides an overview of the most commonly used data types in Python. If you are just learning, don't expect yourself to memorize all this information all at once - the most commonly used data types will be covered in more depth in the chapters where they are used. For now, just read over the examples and let it soak in. You can then refer back to this page if you later encounter one of these data types and need to remember how it works. If you are already familiar with other programming languages, and feel comfortable seeking out information about each data type online, this page may be sufficient to jump-start your exploration of Python. To complete this section you will need: « Acomputer with Anaconda Python installed. If you aren't set up with Anaconda Python, see Exploring Python (./exploring_python.ipynb) * To complete the exercise you will need familiarity with basic molecular biology terminology (e.g. DNA, RNA, protein, the Central Dogma). What is a data type and why do | need one? In our everyday lives, we use all different kinds of data, organized in a variety of ways. We might enter a PIN number to use a debit card. We may keep a TODO list or a list of groceries. If we encounter an unfamiliar term, we might look up its definition in a physical or online dictionary or the glossary of a textbook. Similarly, when tackling a bioinformatics project, we may need to organize many different kinds of data: lists of genes or files, annotations of gene function, or the numerical results of calculations. When programming, data structures are specific ways of holding and organizing information. Each works best for certain types of data, and each provides different ways of interacting with that data. Becoming fluent in pythons data types - and knowing when to use each - will go a long way towards becoming a productive Python programmer. Data types you've probably already encountered... already used three python data types: * when you typed print("Hello World!"), the text "Hello World!" was represented as a string (str) object. Strings are a built-in data type that holds text.