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.
x = 5, and the same name can later hold a string. The object carries the type, not the
variable (see names & objects). Optional type hints
(x: int = 5) exist for readability and tooling, but they don't change runtime behaviour.{ } for blocks and ; to
end statements, with whitespace ignored. Python deletes both: a : opens a block and the
indentation (4 spaces, consistently) defines what's inside it. Misaligned code isn't ugly — it's a
different program, or an error.new, no boilerplate public static void main,
collections have literal syntax ([], {}). The result is fewer lines that read
closer to the intent.Pick a concept and compare the two languages line for line — the highlighted parts are where the habit changes:
== vs isThis 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.)
Beyond syntax, a handful of names differ: null→None,
true/false→True/False, && / || / !→and / or /
not, this→self (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.
: + 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.