Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jcomte23/Python_vanilla/llms.txt
Use this file to discover all available pages before exploring further.
Introduction to Variables
Variables in Python are containers for storing data values. Unlike some other programming languages, Python doesn’t require explicit declaration of variable types - the type is automatically determined based on the value assigned.Variable Types
Python supports several fundamental data types:Integer (INT)
Stores whole numbers without decimal points.Integers can be positive, negative, or zero. Examples:
100, 260, -50, 0Float (FLOAT)
Stores numbers with decimal points (real numbers).Floats can represent both whole numbers and decimals. Examples:
1.24, 2.0, 5.7, 3.14159String (STRING)
Stores text and character sequences.Boolean (BOOL)
Stores logical values - eitherTrue or False.
Booleans are commonly used in conditional statements and logical operations. Only two values are possible:
True or False.Complete Example
Here’s a complete example demonstrating all variable types:Variable Naming Conventions
Python variable names should:
- Start with a letter or underscore
- Contain only letters, numbers, and underscores
- Be descriptive and use snake_case for multi-word names
- Avoid Python reserved keywords
Type Checking
You can check the type of any variable using thetype() function:
Key Takeaways
- INT: Whole numbers only (e.g.,
100,260) - FLOAT: Numbers with decimals (e.g.,
1.24,5.7) - STRING: Text values (e.g.,
'Juan','Compras') - BOOL: Logical values (
TrueorFalse)