.. include:: Programmierung Grundlagen, anhand von Python (2022-01-17 - 2022-01-10) ====================================================================== .. sidebar:: *Training Information* **Offizielle Beschreibung** `tecTrain "Programmierung Grundlagen" `__ **Material** * :doc:`/trainings/material/soup/python/basics/group` * `Github Repository `__ .. contents:: :local: Überblick --------- Die Kurssprache des Kurses "Programmierung Grundlagen" ist Python; viele der Python-spezifische Elemente werden von :doc:`hier ` unterrichtet. Jupyter Notebook ---------------- * :doc:`Structure ` * :doc:`Whole notebook ` Log --- Tag 1 ..... Variablen und Datentypen ```````````````````````` * :doc:`/trainings/material/soup/python/basics/python_0110_blahblah/topic` * :doc:`/trainings/material/soup/python/basics/python_0120_helloworld/topic` * Hello World: `hello.py `__ * Commandline arguments: `argv.py `__ * :doc:`/trainings/material/soup/python/basics/python_0130_syntax_etc/topic` * Indentation: `indentation.py `__ * :doc:`/trainings/material/soup/python/basics/python_0150_datatypes_overview/topic` * Overflow in C: `overflow.c `__ * :doc:`/trainings/material/soup/python/basics/python_0160_boolean/topic` * :doc:`/trainings/material/soup/python/basics/python_0300_strings/topic` * Encoding: ``Liebe Grüße, Jörg`` in UTF-8 `umlaut-utf8.txt `__ * Encoding: ``Liebe Grüße, Jörg`` in ISO-8859-1 `umlaut-iso-latin-1.txt `__ * :doc:`/trainings/material/soup/python/exercises/herdt/swap` * Swap: `swap.py `__ * Swap, Pythonic version: `swap-pythonic.py `__ .. image:: wacom-sketches/swap.png :scale: 50% Kontrollstrukturen `````````````````` * :doc:`/trainings/material/soup/python/basics/python_0170_if/topic` * :doc:`/trainings/material/soup/python/exercises/herdt/max_numbers` * Maximum: `maximum.py `__ * Maximum, Pythonic version `maximum-pythonic.py `__ * :doc:`/trainings/material/soup/python/exercises/herdt/greet` * `greet.py `__ Tag 2 ..... * :doc:`/trainings/material/soup/python/basics/python_0193_while/topic` * :doc:`/trainings/material/soup/python/exercises/herdt/exercise_while_even_numbers` * Straightforward (``while``): `even.py `__ * Straightforward (using ``for``; slightly better): `even-for.py `__ * Even-number *generator*: `even-yield.py `__ * Not programming anything, but rather using ``range()``'s *step-width* parameter: `even-ultimate-pythonicity.py `__ * :doc:`/trainings/material/soup/python/exercises/legacy/while_primeness` .. image:: wacom-sketches/prime.png :scale: 50% * `prime.py `__ * :doc:`/trainings/material/soup/python/basics/python_0200_sequential_types/topic` * :doc:`/trainings/material/soup/python/basics/python_0210_indexing_slicing/topic` * :doc:`/trainings/material/soup/python/basics/python_0220_for/topic` * :doc:`/trainings/material/soup/python/basics/python_0150_datatypes_overview_compound/topic` * Sequential search in output list (bad): `uniq-sequential.py `__ * Constant-time search in ``set`` (good): `uniq-set.py `__ * :doc:`/trainings/material/soup/python/exercises/legacy/cmdline_digit` * `digit.py `__ Tag 3 ..... * :doc:`/trainings/material/soup/python/basics/python_0270_functions/topic` * :doc:`/trainings/material/soup/python/basics/python_0270_functions/slideshow` * :doc:`/trainings/material/soup/python/basics/python_0270_functions/screenplay-scoping` * :doc:`/trainings/material/soup/python/exercises/legacy/max_numbers_function` * :doc:`/trainings/material/soup/python/exercises/legacy/uniq_function` * `uniq-function.py `__ * Using ``dict.fromkeys()``: `uniq-fromkeys.py `__ * :doc:`/trainings/material/soup/python/exercises/legacy/uniq_generator` * :doc:`/trainings/material/soup/python/basics/python_0400_lists/topic` * :doc:`/trainings/material/soup/python/basics/python_0450_dictionaries/topic` * :doc:`/trainings/material/soup/python/basics/python_0460_sets/topic` Talking about searchable datastructures, like in ``dict`` and ``set`` (those are implemented as hash tables, btw.) * Hash Table .. image:: hashtable.png :scale: 40% * Red-Black Tree .. image:: rbtree.png :scale: 40% * :doc:`/trainings/material/soup/python/basics/python_0320_strings_methods/topic` * :doc:`/trainings/material/soup/python/basics/python_0500_files/topic` * Using ``f.readline()`` (EOF is clumsy): `passwd-readline.py `__ * Pythonic, using iteration: `passwd-iter.py `__ * :doc:`/trainings/material/soup/python/exercises/legacy/distill` * `distill.py `__ * :doc:`/trainings/material/soup/python/exercises/legacy/passwd` * Larger OO/modules/database "project" `see here `__ Tag 4 ----- * :doc:`/trainings/material/soup/python/advanced/modules` * :doc:`/trainings/material/soup/python/advanced/oo/group` * SQL * :doc:`/trainings/material/soup/python/misc/db/dbapi2` * :doc:`/trainings/material/soup/python/misc/db/sqlite3` * Exercise: larger OO/modules/database "project" `see here `__ Links ----- * `PHP: A Fractal of Bad Design `__