5
Inhaltsverzeichnis
Einleitung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Warum Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
An wen wendet sich dieses Buch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Inhalt und Aufbau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Hinweise zur Typographie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Programmbeispiele . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1 Grundlagen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1 Was ist Programmieren? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.2 Hardware und Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.3 Programm als Algorithmus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.4 Syntax und Semantik . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.5 Interpreter und Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.6 Programmierparadigmen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.7 Objektorientierte Programmierung . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7.1 Strukturelle Zerlegung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7.2 Die Welt als System von Objekten . . . . . . . . . . . . . . . . . . . . . . 34
1.7.3 Objekte besitzen Attribute und beherrschen Methoden . . . . 35
1.7.4 Objekte sind Instanzen von Klassen . . . . . . . . . . . . . . . . . . . . 36
1.8 Hintergrund: Geschichte der objektorientierten
Programmierung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.9 Aufgaben . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.10 Lösungen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2 Der Einstieg – Python im interaktiven Modus . . . . . . . . . . . . . . . . . . . 39
2.1 Python installieren . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.2 Python im interaktiven Modus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.2.1 Start des Python-Interpreters in einem Konsolenfenster . . . 42
2.2.2 Die Python-Shell von IDLE . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.2.3 Die ersten Python-Befehle ausprobieren . . . . . . . . . . . . . . . . 43
2.2.4 Hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.3 Objekte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Get Python 3 - Lernen und professionell anwenden now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.