Junior — Middle
How are immutable values intended for use as constants declared in Python?
sobes.tech AI
Answer from AI
In Python, there is no built-in mechanism for declaring true constants, but by convention, immutable values are indicated by names in uppercase.
Example:
PI = 3.14159
MAX_CONNECTIONS = 10
This signals to other developers that these variables should not be changed in the code. For stricter control, special classes or modules can be used, but this is not standard practice.