Typing Support In JavaScript, variables are dynamic by default — you can assign a number, then later a string, and it still works. TypeScript adds type safety, so you can catch errors early. Python is also dynamically typed , but with type hints (introduced in PEP 484), you can write code that feels closer to TypeScript. Type hints don’t change how Python runs your code, but tools like can check for mistakes before runtime. Declaring Variables with Types This looks similar to TypeScript: Without type hints, Python still runs fine: With type hints, you expect the variable to stay consistent: Function Type Hints Just like in TypeScript, you can specify input and output types. JS/TS equivalent: Working with Collections Example – Inventory Item Here type hints make it clear: is a dictionary of strings to integers. must be an integer. Function returns (like in TypeScript). ✅ Why it matters : Type hints make Python code self-documenting and reduce runtime bugs, just like TypeScript improves plain JavaScript. From now on, we’ll use strict typing in our examples to encourage clean coding.