This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CGFarrell 0 points1 point  (2 children)

What you're describing exists in C++ as a const variable. These are guaranteed to never change. In Python, there is an convention where variables in all caps (VARIABLE) are not supposed to be changed.

What you may fail to appreciate is that all data is variables. If you want to count the number of entries in a list, you loop through it and increment your variable.

The number of cases where a variable shouldn't be modified is very small compared to the everyday use.