PYTHON
Introduction to the Basics
March 2021 S. Linner, M. Lischewski, M. Richerzhagen Forschungszentrum Jülich
Member of the Helmholtz Association
Table of Contents
Introduction
Data Types I
Control Statements
Functions
Input/Output
Errors and Exceptions
Data Types II
Object Oriented Programming
Modules and Packages
Advanced Techniques
Tools
Regular Expressions (optional)
Summary and Outlook
Member of the Helmholtz Association
Slide 1
Table of Contents
Introduction
Data Types I
Control Statements
Functions
Input/Output
Errors and Exceptions
Data Types II
Object Oriented Programming
Modules and Packages
Advanced Techniques
Tools
Regular Expressions (optional)
Summary and Outlook
Member of the Helmholtz Association
Slide 2
What is Python?
Python: Dynamic programming language which supports several different programing
paradigms:
Procedural programming
Object oriented programming
Functional programming
Standard: Python byte code is executed in the Python interpreter (similar to Java)
→ platform independent code
Member of the Helmholtz Association
Slide 3
Why Python?
Extremly versatile language
Website development, data analysis, server maintenance, numerical analysis, ...
Syntax is clear, easy to read and learn (almost pseudo code)
Common language
Intuitive object oriented programming
Full modularity, hierarchical packages
Comprehensive standard library for many tasks
Big community
Simply extendable via C/C++, wrapping of C/C++ libraries
Focus: Programming speed
Member of the Helmholtz Association
Slide 4
History
Start implementation in December 1989 by Guido van Rossum (CWI)
16.10.2000: Python 2.0
Unicode support
Garbage collector
Development process more community oriented
3.12.2008: Python 3.0
Not 100% backwards compatible
2007 & 2010 most popular programming language (TIOBE Index)
Recommendation for scientific programming (Nature News, NPG, 2015)
Current version: Python 3.9.2
Python2 is out of support!1
1https://python3statement.org/
Member of the Helmholtz Association
Slide 5
Zen of Python
20 software principl