On Tue, Aug 8, 2017 at 7:19 AM, Stefan Ram <r...@zedat.fu-berlin.de> wrote:
> I am planning a Python course. > > I started by writing the course akin to courses I gave > in other languages, that means, the course starts roughly > with these topics: > > - number and string literals > - types of number and string literals > (just giving the names »int«, »float«, and »string«) > - using simple predefined operators (+, -, *, /) > (including 2*"a" and "a"+"b") > - calling simple predefined functions (len, type, ...) > > . This is a little bit boring however and might not > show off Python's strength early in the course. > > So, I now think that maybe I should start to also > include list (like > > [1,2,3] > > ) right from the start. A list conceptually is not > much more difficult than a string since a string > "abc" resembles a list ["a","b","c"]. I.e., the > course then would start as follows: > > - number, string, and list literals > - types of number, string and list literals > (just giving the names »int«, »float«, »string«, > and »list«) > - using simple predefined operators (+, -, *, /) > (including 2*"a", "a"+"b", 2*["a"], and [1]+[2]) > - calling simple predefined functions (len, type, ...) > > However, once the box has been opened, what else > to let out? What about tuples (like > > (1,2,3) > > ). Should I also teach tuples right from the start? > > But then how to explain to beginners why two > different types (lists AND tuples) are needed for > the concept of a linear arrangement of things? > > Are there any other very simple things that > I have missed and that should be covered very > early in a Python course? > > (Especially things that can show off fantastic > Python features that are missing from other > programming languages, but still only using > literals, operators and function calls.) > > -- > https://mail.python.org/mailman/listinfo/python-list > One thing I find that gets overlooked in a lot of beginner Python courses is Python's module system. Covering the module system will allow you to hit on the subject of namespacing and scope. Python's module system is one of its greatest strengths in my opinion. No other language I've used makes it so simple to structure a project. Another idea: Dictionaries Dictionaries are a conceptually simple data structure that should be easy for beginners to grok. Obviously, their implementation is a bit complex, but I don't think you would need to get into that. Dictionaries are very powerful data structures that can be used to keep code DRY and store important data to be accessed from anywhere in an application or script. Dictionaries also have a time complexity average of O(1) for read access which makes them fairly efficient. -- https://mail.python.org/mailman/listinfo/python-list