Variables

Compare how variable declaration, scoping, and mutability work across languages and examine their execution mechanics.

Cross-Language Reference Table

Click on a highlighted concept to explore detailed comparison and code examples.

ConceptPythonJavaJavaScriptCC++
Declarationx = 5int x = 5;let x = 5;int x = 5;int x = 5;
ScopeFunction / GlobalBlock / Method / ClassBlock / Function / GlobalBlock / Function / FileBlock / Function / Namespace
ConstantsCAPITAL_NAME (convention)finalconstconst / #defineconst / constexpr

Explore Concepts

Select a variable concept below to learn more