Python

Python from scratch to data structures: variables, loops and functions from FP1, and classes, inheritance, exceptions, testing and linked lists from FP2. Everything explained step by step, with real programs and solved exercises (with an exam-style quiz in FP2), by someone who learned Python at ULPGC very recently.

61 articles

  1. Variables

    Types, assignment, input() and conversions

    Exam-style quiz
  2. Operators

    Arithmetic, // and %, comparison and logic

    Exam-style quiz
  3. Debugging

    Tracebacks, debug prints and pdb

  4. Conditionals

    if, elif, else and compound conditions

    Exam-style quiz
  5. Loops

    for, while, range, break and continue

    Exam-style quiz
  6. Functions

    Parameters, return, scope and the call stack

    Exam-style quiz
  7. Exceptions

    try, except, raise and assert

    Exam-style quiz
  8. Classes

    Objects, encapsulation and magic methods

    Exam-style quiz
  9. Inheritance

    super(), overriding, polymorphism and abstract classes

    Exam-style quiz
  10. Operator overloading

    __add__, __eq__, __str__ and friends

    Exam-style quiz
  11. Iterators and generators

    iter, next, yield and the for loop inside

    Exam-style quiz
  12. Testing

    White box, black box, TDD and unittest

    Exam-style quiz
  13. LinkedList

    Nodes, links, inserting and deleting

    Exam-style quiz
  14. Modules

    import, packages and if __name__ == "__main__"

    Exam-style quiz
  15. Lists and tuples

    Indexes, slices, methods and traversals

    Exam-style quiz
  16. Mutability and copies

    References, copies, matrices and comprehensions

    Exam-style quiz
  17. Recursion

    Base case, call stack and fast recursion

    Exam-style quiz
  18. Associative containers

    Dictionaries, sets and nested structures

    Exam-style quiz
  19. Strings

    Indexes, str methods and formatted f-strings

    Exam-style quiz
  20. Regex

    Patterns, groups, re.findall and quantifiers

    Exam-style quiz
  21. Text files

    open, modes, reading, writing and with

    Exam-style quiz