Python Identity and Membership Operators
Learn how Python identity operators is and is not compare object memory, and how membership operators in and not in check whether a value exists inside a collection.
Learn Python programming from scratch
Learn how Python identity operators is and is not compare object memory, and how membership operators in and not in check whether a value exists inside a collection.
Learn how Python bitwise operators AND, OR, XOR, NOT, left shift, and right shift manipulate integers at the binary level, and when to use each one.
Learn how Python determines which operator runs first when multiple operators appear in an expression, and how to use parentheses to control evaluation order safely.
Learn how Python short-circuit evaluation works with and and or operators, why it stops evaluating as soon as the result is determined, and how to use it safely.
Learn the most common Python operator mistakes including confusing assignment with equality, misreading precedence, misusing identity operators, and flawed short-circuit patterns.
Learn what Python functions are, why they matter for organizing code, and how they form the foundation of non-trivial programs.
Learn the exact syntax for defining and calling Python functions with the def keyword, including naming rules, the function body, and how the call stack works.
Learn the difference between parameters and arguments, how to pass values by position and by keyword, and the rules for default parameter values.
Learn how Python functions send results back with the return statement, how to return multiple values, and the difference between returning and printing.
Understand Python's LEGB scope rules: local, enclosing, global, and built-in. Learn where variables are visible and why functions isolate their local state.
Learn the practical differences between local and global variables, when to use each, and how to avoid the most common scope-related bugs in Python functions.
Master the two ways to pass arguments to Python functions: by position and by keyword. Learn the rules for mixing them and when to choose each style.