Introduction to Python
Python is a high level, dynamically typed, interpreted language whose whole design goal is that a program should be as easy to read as it was to write...
A complete core Python path: syntax, data types, operators, strings, control flow, collections, functions, exceptions, files, modules, the standard library, OOP, iterators, generators, decorators, internals, concurrency, regular expressions, testing, typing, performance, security, problem solving, projects, interview preparation and exams.
110 notes in 33 topics
Python is a high level, dynamically typed, interpreted language whose whole design goal is that a program should be as easy to read as it was to write...
Install Python, check the version, meet the REPL, write a script and understand the difference between interactive mode and script mode.
Source code is compiled to bytecode and the Python Virtual Machine executes it. Knowing that explains __pycache__, import speed and most confusing err...
Indentation defines blocks, statements end at the line break, and a short set of rules about comments, keywords and identifiers covers everything else...
A Python variable is a name bound to an object, not a box holding a value. That one distinction explains multiple assignment, swapping, dynamic typing...
Python ships with a small set of built in types. Sorting them by three questions - single value or container, ordered or not, changeable or not - make...
Integers are unbounded, floats are binary approximations, division always produces a float, and bool is quietly an integer. Each of those facts change...
type() names the class, id() names the object and isinstance() answers the question you usually meant to ask. Together they explain every aliasing sur...
Python converts numeric types automatically inside an expression and refuses everything else. Explicit conversion is a set of constructor functions, e...
The seven arithmetic operators, the augmented assignment family and the six comparisons, including the chained comparison form that other languages do...
and, or and not return one of their operands rather than a boolean. in tests membership. is tests identity. Each has a use where the others are wrong.
Six operators that work on the individual bits of an integer. Rarely needed in everyday code, routinely needed for flags, masks, permissions and inter...