.. include:: Python Basics (28.9.2020 - 30.9.2020) ===================================== .. contents:: :local: .. sidebar:: *Training Information* **Start** Monday 28.9.2020, 9:00 **Official Description** :doc:`/trainings/material/soup/python/basics/group` **Material** .. csv-table:: Python material, :doc:`/trainings/material/soup/python/group` :doc:`OpenTraining ` Topics, :doc:`/trainings/material/soup/python/group` Preparation ----------- Workspace Setup ............... * :doc:`/trainings/material/soup/python/basics/installation` * :doc:`/trainings/material/soup/python/misc/vscode` Github for Exercises .................... Please create `Github `__ accounts and send them to training@faschingbauer.co.at. We will do exercises via a private repository on Github. (See the :doc:`privacy statement `.) Agenda ------ This is a preliminary list of topics. Audience is three persons from a homogeneous team - chances are that we will deviate as much as we can. * Variables and Types * Numerical types such as integer, floating point, boolean * Sequential types such as list, tuple, string * Indexing, slicing and other operations on sequential types * Associative types such as dictionaries and sets * Mutable versus immutable * Control Flow * ``if`` * ``while`` * ``for``: more about *iteration* * Functions * Why and how * Parameters passing: positional versus keyword parameters, default parameters * Return values * Exception Handling * The exception hierarchy in the standard library * How to define custom exception classes * Raising exceptions, and reacting on them * Strings — Advanced Features * String methods * Formatting * Encoding: what it is, and how Python solves encoding problems * File I/O * Opening and/or creating files * Reading and writing Log --- Day 1 ..... Day 2 ..... * Datastructures: ``list``, `dict``, ``set`` * Functions, parameter passing * Generators * Exercises: ``exercise4/joerg/uniq.py``, ``exercise4/joerg/uniq-yield.py``. Fill in comments, move into ``livehacking/``. * Discussion: *lookup* runtime behavior of data structures (``list`` vs. ``set``). *Make a dedicated section in summary page.* Day 3 ..... * File IO; https://www.youtube.com/watch?v=Uh2ebFW8OYM * Modules and packages; https://www.youtube.com/watch?v=f26nAmfJggw * Demo hacking * ``livehacking/uniq-modularized/`` * Group exercise ``group-exercise/`` Links ----- https://www.youtube.com/watch?v=5qQQ3yzbKp8&lc=UghArKscoP9uTHgCoAEC