Python Symbols and Keywords Table (English)
| Category | Symbol / Keyword | Code Example | Description & Meaning |
| Control Flow | if | if dist_1 < dist_2: | Runs a block of code only if the specified condition evaluates to |
| Control Flow | else | else: | Runs an alternative block of code when the preceding |
| Control Flow | for | for i in x: | Iterates over a sequence (such as a list or range) a specific number of times |
| Control Flow | while | while True: | Repeats a block of code continuously as long as the given condition remains |
| Control Flow | def | def my_function(x): | Used to declare and define a new custom function |
| Control Flow | return | return result | Exits a function and returns a result or value back to the caller |
| Data Structures | [ ] | x = [-1.5, 0, 1.5] | Square brackets: Creates a List (an ordered collection of items) |
| Data Structures | { } | s = {1, 2, 3} | Curly braces: Creates a Set (an unordered collection of unique items) |
| Data Structures | ( ) | print("Hello") | Parentheses: Used to call functions, pass arguments, or group expressions |
| Operators | ** | y = i**2 | Exponentiation / Power operator (e.g., $i^2$ or $i$ raised to a power) |
| Operators | * | y = 5 * x | Multiplication operator |
| Operators | < / > | if a < b: | Comparison operators for "less than" ( |
| Operators | = | a = 3 | Assignment operator (stores a value or object inside a variable) |
| Syntax & Comments | # | # Single line comment | Single-line comment. Python ignores any text written after this symbol on the same line |
| Syntax & Comments | """ | """ Multi-line comment """ | Triple quotes: Used for multi-line comments or docstrings |
| Syntax & Comments | : | if x > 0: | Colon: Marks the beginning of an indented block of code (used after |
No hay comentarios:
Publicar un comentario