Skip to content
Topic

Python

Python tutorials from scratch to advanced, the best language for data science, machine learning, Artificial Intelligence and much more

31 guides

Write Your Own Python Modules and Packages: __init__.py and if __name__ == “__main__” Python Write Your Own Python Modules and Packages: __init__.py and if __name__ == “__main__” Python __name__ == "__main__" explained: write your own modules and packages, __init__.py, relative imports, python -m and how to fix a circular… November 17, 2026 · 14 min read
Python Modules: import and the Standard Library Python Python Modules: import and the Standard Library Python import module guide for beginners: import, from-import and as, why to avoid import *, dir(), sys.path, stdlib modules and ModuleNotFoundError fixes. November 17, 2026 · 13 min read
Python Recursion: Base Case, Call Stack and RecursionError Python Python Recursion: Base Case, Call Stack and RecursionError Python recursion for beginners: base case and recursive case, factorial, nested list sum, the call stack, RecursionError, sys.getrecursionlimit() and loops. November 16, 2026 · 11 min read
Python Lambda Functions: sorted() with key, map() and filter() Python Python Lambda Functions: sorted() with key, map() and filter() Python lambda functions with real examples: sort tuples and dicts with sorted(key=...), reverse=True and itemgetter, plus map() and filter() vs comprehensions. November 15, 2026 · 12 min read
Python Variable Scope: LEGB, global and nonlocal Python Python Variable Scope: LEGB, global and nonlocal Python variable scope for beginners: local vs global, the LEGB rule, UnboundLocalError with a real fix, global, nonlocal, closures and why to… November 14, 2026 · 13 min read
Python Function Arguments: Defaults, Keyword Arguments, *args and **kwargs Python Python Function Arguments: Defaults, Keyword Arguments, *args and **kwargs Python function arguments explained: defaults, keyword arguments, *args, **kwargs, keyword-only and positional-only parameters, and the mutable default trap. November 14, 2026 · 11 min read
Python Functions: def, return, Parameters and Docstrings Python Python Functions: def, return, Parameters and Docstrings Python functions for beginners: define with def, call, parameters vs arguments, return vs print, return several values, None and docstrings, with real… November 13, 2026 · 11 min read
Python List, Dict and Set Comprehensions with if, else and Nested Loops Python Python List, Dict and Set Comprehensions with if, else and Nested Loops Python list comprehension for beginners: filter with if, use if else, build dict and set comprehensions, use nested loops, and know when… November 12, 2026 · 12 min read
Python String Methods and Slicing: split(), join(), strip() and Reversing Strings Python Python String Methods and Slicing: split(), join(), strip() and Reversing Strings Python string methods and slicing for beginners: slice with a step, reverse with [::-1], upper, lower, strip, replace, split, join, find, count… November 11, 2026 · 11 min read
Python List vs Tuple vs Set vs Dict: Which One to Use Python Python List vs Tuple vs Set vs Dict: Which One to Use Python list vs tuple vs set vs dict: a comparison table, a real timeit test of in on a list vs a… November 11, 2026 · 12 min read
Python Sets: add(), discard(), Union, Intersection and Removing Duplicates Python Python Sets: add(), discard(), Union, Intersection and Removing Duplicates Python sets for beginners: create a set, the set() vs {} trap, add, remove and discard, union, intersection and difference, remove duplicates… November 10, 2026 · 13 min read
Python Dictionary: Keys, Values, get() and Looping with items() Python Python Dictionary: Keys, Values, get() and Looping with items() Python dictionary tutorial for beginners: create a dict, get() vs [], KeyError, add, update and delete keys, loop with items(), order and… November 10, 2026 · 11 min read