Introduction to Programming with Python.¶
This course aims to introduce the basics of programming to biologists using the Python language.
About the Course¶
This course is intended for biologists without any skills in programming but strong motivation to learn how to write their own programs, or for advanced beginners who need to complement their skills with concepts.
At the end of the week, the student will be able to automate some repetitive tasks, and open a file, parse it, do basic computations and write the results in a file.
Although all exercises are based on biological data, this course will not be focused on how to analyse data. It will not cover the use of external bioinformatics tools.
Recommended Background¶
There are no prerequisite skills in programming but notions in unix (structure of file systems, files, directories, absolute/relative paths, and permissions, or equivalent to Unix-I course) would be an advantage, although this is not essential.
This course is very intensive and needs highly motivated candidates.
Syllabus:
Introduction
Variables, Expressions and Statements
Introduction to Functions
Data Types
Collection Data Types
Logical Operations
Control Flow Statements
Dive into Functions
Input/Output
Modules and Packages
Object Oriented Programming
Conventions¶
In this course, you will encounter blocks containing code. It is important to realize that this code can belong to two completely distinct interfaces.
Lines prefixed with $
are meant to represent a command-line prompt in a Unix-like shell:
$ python3
Those prefixed with >>>
are meant to represent the prompt of an interactive Python interpreter:
>>> print("Hello world!")
When you try those commands:
Type them in the appropriate interface.
Don’t include the prompt symbols (
$
or>>>`
).
Please note that commands are case-sensitive: The effect will be different if you use capitals instead of small case characters, or the contrary.
Miscellanea¶
Contents¶
- 1. Introduction
- 2. Variables, Expressions and Statements
- 3. Introduction to Functions
- 4. Data Types
- 5. Collection Data Types
- 6. Logical Operations
- 7. Control Flow Statements
- 8. Dive into Functions
- 9. Input/Output
- 10. Modules and Packages
- 11. Object Oriented Programming
- 12. From script to a project in Python
- 13. Scripting
- 14. Further Reading
- 15. Appendix