The Cobox — Knowledge is Growth
Tutorials, course notes and interview questions, free for everyone who wants to learn.
- All
- Python 133
- Tools 30
- Tutorials 20
- DATABASE 10
- PHP 8
- C & C++ 5
- Java 4
- Web Development 2
- General Blogs 1
-
Python lists: indexing, methods, sorting, copying and comprehensions
Everything about the Python list: creating and accessing items, mutability, looping, the important methods, append versus insert, remove versus pop, sorting, aliasing and copying, nested lists and comprehensions, with tested output.
-
Python modules: import styles, aliases, reload, random and __name__
What a Python module is and how to use one: the four import styles, module and member aliases, dir() and help(), reloading a changed module, the random module, and the special __name__ variable, with tested output.
-
Python database programming: the DB-API, SQLite, queries and safe parameters
How Python talks to databases: the standard steps (connect, cursor, execute, fetch, commit, close), parameterised queries against SQL injection, transactions and errors, shown on SQLite with notes for MySQL and Oracle.
-
Python logging: levels, handlers, formatters and configuration
Replace print debugging with the logging module: levels, basicConfig, formatting, writing to files, logging exceptions, named loggers and handlers, filters and dictConfig, with tested output.
-
Python operators: arithmetic, comparison, logical, bitwise, assignment and more
Every Python operator explained with tested examples: arithmetic, comparison and chained comparison, logical short-circuiting, bitwise and shift, assignment, ternary, identity, membership, precedence and the math module.
-
Python multithreading: threads, locks, semaphores, events and queues
How to run work in several threads in Python: creating and joining threads, daemon threads, race conditions, Lock and RLock, semaphores, Event, Condition, Queue, thread pools, and the GIL limitation.
-
Python regular expressions: the re module, patterns, groups and flags
A practical guide to regular expressions in Python: character classes, quantifiers, anchors, the main re functions, groups, flags, greedy versus lazy matching, lookarounds and real patterns, with tested output.
-
Python modules and packages: import, __init__.py, relative imports and __name__
How Python organises code: modules, packages, __init__.py, absolute and relative imports, running a file as a script versus importing it, the search path and the errors you will meet, with a runnable example.
-
Python sets: unique items, set operations and frozenset
How Python sets work: creating them, adding and removing items, union, intersection and difference, membership speed, frozenset, set comprehensions, and practical uses like removing duplicates.
-
Python strings: indexing, slicing, methods and formatting
A complete tour of the Python str type: literals, indexing and slicing, searching, replacing, splitting and joining, case and character checks, formatting with f-strings, and Unicode basics, all with tested output.
-
Python tuples: creation, immutability, packing, unpacking and tuple vs list
What a tuple is, how to create and access one, why it is immutable (and the catch), packing and unpacking, tuple comprehension myths, namedtuple, and when to choose a tuple over a list.
-
Python language fundamentals: identifiers, keywords, data types and type casting
The building blocks of every Python program: naming rules for identifiers, reserved words, the built-in data types, number systems, type conversion and constants, with tested examples.