Python is an interpreted, high-level, general-purpose programming language. Because it is interpreted, Python code is executed line-by-line by the Python interpreter without requiring a separate compilation step.
Key Architectural Characteristics
- Indentation as Syntax: Unlike C, C++, or Java that use curly braces
{ }to define code blocks, Python uses consistent whitespace indentation (typically 4 spaces). Improper indentation raises anIndentationError. - Dynamic Typing: In Python, you do not need to declare variable types (like
int x). The interpreter automatically detects and binds the data type based on the assigned value (e.g.,x = 10is an integer;x = "Ranchi"is a string). - Console I/O: Output is displayed using
print(). User input is collected usinginput(), which ALWAYS returns data as a String (str). To perform arithmetic, input must be explicitly typecast:age = int(input("Enter age: ")).