Skip to Content
0 likes
Python f-Strings: Print Things People Can Actually Read Level: Beginner

If a person reads your output, format it. f-strings let you mix text and values, round numbers, add thousands separators and line up a table, with very little code. Formatting is for people, not for data files.

0 likes
Python Lists in 15 Minutes: Add, Remove, Loop, Done Level: Beginner

The four list moves you need on day one: make a list, add to it, remove from it, and loop over it. Plus the one mistake that gives wrong results without any error. Nothing more. The rest can wait until you need it.

0 likes
Python try/except: Catch the Error You Expect, Not Every Error Level: Beginner

A bare except hides typos and real bugs behind wrong results. Catch the specific error you expect, keep the try block small, and let everything else crash where you can see it.

0 likes
Python Function Arguments: Defaults, Keywords and the Mutable Default Trap Level: Beginner

Defaults make functions easier to call and keywords make calls easier to read. A list as a default value is created once and shared by every call. Here's why, and the one-line fix.

0 likes
Python if, elif and else: Writing Conditions That Don't Overlap Level: Beginner

An if/elif chain stops at the first true condition. Put the widest one first and the others never run, with no error. Order your conditions, test the edges, and make else mean what you think.

0 likes
Python Division and Rounding: /, //, % and round() Without Surprises Level: Beginner

/, //, % and round() each do exactly what they say, and that's not always what school math taught you. Negative numbers, halves and money are where the surprises are, and where Decimal comes in.

0 likes
Python Type Conversion: Why "5" + 5 Fails and How to Fix It Level: Beginner

Python refuses to guess whether "5" + 5 means 55 or 10. Convert with int(), float() and str() where values come in, handle text that won't convert, and avoid the bool("False") trap.

0 likes
Python while Loops: Keep Asking Until the Input Is Valid Level: Beginner

People type the wrong thing, sometimes more than once. A while True loop with try/except, a range check and a way out keeps asking until the answer is usable, so the rest of your code never has to check again.

0 likes
Make a Button Do Something With addEventListener Level: Beginner

Find the button, attach a listener, change something on the page when it's clicked. Three steps, and two mistakes that make it silently do nothing.

0 likes
JavaScript Arrays in 15 Minutes Level: Beginner

Arrays hold lists: cart items, names, scores. Create them, read them, add and remove items, find things, and copy them without changing the original by accident.

0 likes
Arrow Functions in 10 Minutes Level: Beginner

Arrow functions are a shorter way to write a function, and they are everywhere in modern JavaScript. Learn the short forms, the object-return trap, and the one place you shouldn't use them.

0 likes
Fix Form Comparisons That Confuse Blank Input With Zero Level: Beginner

Separate missing, invalid and numeric form input, then compare normalized quantities without treating an empty field as zero.