Python's mutable default argument bug, run one call at a timeThis function looks fine. It adds a tag to a list and returns the list. If you don't pass a list, it starts a new empty one. At least that's what it seems to do. def add_tag(tag, tags=[]): tags.ap4d ago · 6 min readrealdev9868.hashnode.dev
The Python Copy Bug That Looks Fine in Code ReviewHere is a bug that is easy to ship. A function takes a dict of default settings and hands each new user a copy. Someone adds a tag to one user. Every future user now has that tag too. The code looks hOct 20 · 6 min readrealdev9868.hashnode.dev
Pandas Basics on a Real Dataset: A Hands-On Walkthrough with Palmer PenguinsMany pandas tutorials build a five-row DataFrame from a dictionary, so the data is already clean. Real data has missing values, text where you expected numbers, and questions you have to turn into codOct 19 · 7 min readrealdev9868.hashnode.dev
Belady's Anomaly: FIFO vs LRU vs Optimal, Checked in PythonPage replacement questions in GATE CS are mostly counting. You get a reference string, a number of frames and a policy, and you write a row of letters. The idea is easy; the marks go when you lose traOct 17 · 6 min readrealdev9868.hashnode.dev
A 30-Day DSA Plan for Placements, Built Around Patterns (Not Problem Counts)A common way to prepare for placement coding rounds is to open a list of hundreds of problems and start at number one. A month later, a new problem still feels like a blank page. A better approach: le1Oct 15 · 7 min readrealdev9868.hashnode.dev