30
loading...
This website collects cookies to deliver better user experience
“This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.”
Public variables: these are the “normal” variables, you declare them by writing the variable name then an equal sign and what we want to store. e.g. greeting = ‘hello’
Private variables: these are variables that aren’t part of the public part of the program, is commonly used with APIs, in Python you can access a private variable any time, but what a private variable tells you is that if you change the content you can break the program or create malfunctions in it. e.g _age = 20.
Constants: By convention are all upper case, are values that are not going to change over time. e.g. PI = 3.14159.
“Super private” variables: totally private or please don’t touch me variables these starts with a double underscore. If you change anything inside these variables, you probably are going to break
all your program. e.g __really_important_number = 15.