Python Functions: Writing User-Defined Functions Worth Reusing
How to write Python functions: arguments, defaults, *args and **kwargs, scope, type hints and docstrings, plus the mutable default bug everyone hits once.
Search
15 articles matched your search.
How to write Python functions: arguments, defaults, *args and **kwargs, scope, type hints and docstrings, plus the mutable default bug everyone hits once.
Lists vs tuples in Python beyond 'one is mutable': the real differences in hashability, memory, safety and intent, plus a decision rule that works in practice.
Plotly tutorial for Python: interactive charts in one Plotly Express call, when to use Graph Objects, styling, faceting, and HTML exports 100x smaller.
A Python lambda function is a one-expression anonymous function. Learn where it helps (sort keys, callbacks), when def wins, and the loop bug it causes.
An advanced digital marketing course should teach measurement: attribution, incrementality and SQL. Five options compared, plus a test for outdated syllabi.
NumPy broadcasting explained: the two shape rules, why a (3,1) and a (4,) array give (3,4), and the silent bug that turns a vector sum into a matrix.
Advanced Plotly charts in Python: subplots, dual axes, animation, 3D and heatmaps, plus the axis-range mistake that silently drops points from animations.
Python classes and objects explained with tested code: __init__, self, dunder methods, properties and dataclasses, plus the shared-list bug to learn first.
Iterators and generators in Python explained: yield, pipelines that stream big files in flat memory, itertools, and why a generator silently runs only once.
The 5 Ps of data science (Problem, People, Process, Platform, Portfolio): the question each forces, the failure it exposes, and why the order matters.
Pick an advanced data analytics course that goes past dashboards: five options compared on price and predictive depth, plus the four topics a syllabus needs.
What a data science course for managers should teach AI leaders: the four decisions you will own, the literacy floor and five checks before you pay.
How to use Python tuples well: creating them, unpacking, using them as dict keys, named tuples, and the one-element and += gotchas that catch everybody.
Regular expressions in Python from the ground up: raw strings, core syntax, match vs search vs fullmatch, flags, and five mistakes that silently break patterns.
Python basics with runnable examples: names and objects, lists, dicts and sets, control flow and comprehensions, plus the traps behind most beginner bugs.