Python Strings: F-Strings, Methods and the strip() Trap
Python strings in practice: f-strings, slicing, the methods worth memorising, why += loops slow down, and the encoding default that breaks scripts on Windows.
Search
13 articles matched your search.
Python strings in practice: f-strings, slicing, the methods worth memorising, why += loops slow down, and the encoding default that breaks scripts on Windows.
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.
NumPy tutorial for beginners: what an array is, why it ran about 20 times faster than a list here, how one stray string turns numbers into text, and more.
Advanced Python regex with tested output: named groups, lookarounds, re.sub with a function, and why a 24-character input made (a+)+$ run for 10 seconds.
Python numeric data types explained: int, float, Decimal, Fraction and complex, why 0.1 + 0.2 is not 0.3, and how to handle money without rounding errors.
Inheritance and composition in Python with tested code: when to use each, how super() really works, duck typing, and why deep class hierarchies backfire.
Python operators explained with outputs for every example, plus why is works for 256 but fails for 257 and why and/or rarely return booleans.
Python basics with runnable examples: names and objects, lists, dicts and sets, control flow and comprehensions, plus the traps behind most beginner bugs.
Exception handling in Python done properly: try, except, else and finally, custom exceptions, chaining and logging, and why a bare except can break Ctrl-C.
How to write Python functions: arguments, defaults, *args and **kwargs, scope, type hints and docstrings, plus the mutable default bug everyone hits once.
Programming for data science: how much SQL and Python you need, what reproducible code looks like, the notebook traps, and where AI assistants help or hurt.
Advanced Plotly charts in Python: subplots, dual axes, animation, 3D and heatmaps, plus the axis-range mistake that silently drops points from animations.
Iterators and generators in Python explained: yield, pipelines that stream big files in flat memory, itertools, and why a generator silently runs only once.