Java → Python: the mindset shift

You already know how to program. What changes moving to Python isn't the logic — it's the texture: no type declarations, no semicolons, whitespace that actually matters, and a few traps where a familiar symbol means something different. See the same idea written both ways and the new habits become obvious.

dynamic typingindentation = blocks no semicolons== vs is None / True

The three big shifts

Pick a concept and compare the two languages line for line — the highlighted parts are where the habit changes:

JAVA
PYTHON

The one that bites: == vs is

This pair is inverted from Java and catches everyone. In Java you compare object values with .equals() and reference identity with ==. In Python it's the other way round: == compares values (it calls __eq__), and is compares identity (same object in memory). So you almost always want ==; reserve is for the singletons None, True, False — idiomatically if x is None:. (More in truthiness.)

A few more renames to internalise

Beyond syntax, a handful of names differ: nullNone, true/falseTrue/False, && / || / !and / or / not, thisself (and it's an explicit first parameter, not a keyword — see classes). Comments are #, not //. None of these are hard; they just need a day or two of muscle-memory rewiring.

Takeaways: Python infers types and they're dynamic (no declarations); indentation defines blocks (: + 4 spaces) — there are no braces or semicolons. Watch the inversion: == is value equality, is is identity (use it only for None). Learn the renames (None/True/and/self/#) and lean on the literal collection syntax. The algorithms you know all transfer unchanged.