Variables & Data Types In Python, variables work differently than in JavaScript. You don’t use , , or . You just assign a value, and Python figures out the type automatically. This makes code simpler but also requires you to be aware of how types behave. Declaring Variables JavaScript way: Python way: No . Variable names use snake case instead of camelCase by convention. Boolean values are and (capitalized). String Interpolation In JavaScript, you often use template literals: In Python, you use f-strings, which are very similar but start with f before the string: You can also do expressions inside f-strings: Dynamic Typing Python, like JavaScript, is dynamically typed . You can assign any type of value to a variable, and later change it: Same in JavaScript: If you try to use a variable without assigning it first, Python throws an error — unlike JavaScript which has . Data Types in Python vs JavaScript Concept JavaScript Python Example --------- ------------ -------- --------- String Number (int) Number (float) Boolean Null Array (List) Object (Dict) Undefined (no direct equivalent) Python errors if not initialized Example An online shop in Python: The same in JavaScript: Checking Types In JavaScript, you check the type with typeof: In Python, you use the built-in type() function: Strict Data Types with Type Hints By default, Python doesn’t enforce types. But you can use type hints to make code more readable and safer — similar to TypeScript. This tells other developers (and tools like VS Code or ) that both and should be integers, and the function returns an integer. If you pass a string: But a static checker will warn you that the types don’t match. Quick Takeaway Variables in Python are dynamic , just like JavaScript. Supported types are almost the same: string, int, float, bool, list, dict, plus . Variables can be reassigned to different types at runtime. Use type hints for clarity and tooling support, especially in larger projects.