Safa Mulani

Safa Mulani

An enthusiast in every forthcoming wonders!
Python f-string guide banner showing values flowing into a string

Understanding Python f-string

Debug prints all repeat the same chore, because the variable name gets typed once as a label and once as the value. The f-string shorthand prints both from a single expression, so the label can never drift out of sync…

Python String join method guide banner showing list items merging into one string

Python String join() function

Every list of strings eventually needs to become one string, and the line that does it reads backwards. The separator calls the method while the list supplies the items, so a comma-joined row comes out as a one-liner once you…

Python replace() function

I keep coming back to Python’s replace() function whenever I need to clean up messy text data. Whether I am stripping unwanted characters from a CSV import or standardizing user inputs, replace() handles it without ceremony. No regex needed for…

Python Namedtuple

I first ran into namedtuples when debugging a data pipeline. Reading record[0] and record[1] everywhere was a nightmare – switching to record.city and record.state was a instant clarity upgrade that I came back to every time. A namedtuple is a…