What property does a variable hold when defined as a constant by convention?

Master Python with the PCAP Certification! Explore interactive quizzes and detailed explanations to ensure your exam success. Gain confidence and get certified!

When a variable is defined as a constant by convention, it is typically written in uppercase letters. This practice helps distinguish constants from regular variables, making the code easier to read and understand. Constants are intended to remain unchanged throughout the execution of the program, and using uppercase letters serves as a visual cue to developers that these values should not be modified.

While other options may refer to characteristics of variables in Python, they do not align with the conventions associated with constants. For instance, constants should not be mutable or recalculated, nor is there a requirement that they need to be defined in lowercase. Thus, using uppercase letters is a widely accepted convention in Python to indicate that a variable is a constant.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy