As question states, I am doing homework which have 2 variables BOOK, and MAGAZINE in all capital letters, and I can not figure out what could be the purpose of it.
Anyone have a clue?
The icon in Visio Class Diagram looks like rectangle with equal sign on it and a lock declaring it private.
This is a picture of class diagram.
Regards.
Variable names that consist of a single character may be uppercase. In general, even single-character variable names should be lowercase. However, in some situations, mathematical notation uses uppercase letters. In such situations, uppercase variable names may be used.
A variable name can only have letters (both uppercase and lowercase letters), digits and underscore. The first letter of a variable should be either a letter or an underscore.
The String type is capitalized because it is a class, like Object , not a primitive type like boolean or int (the other types you probably ran across).
Officially, variable names in Python can be any length and can consist of uppercase and lowercase letters ( A-Z , a-z ), digits ( 0-9 ), and the underscore character ( _ ).
They are private constants. You can tell by the icon next to their name. Take a look at the constant TEST in this example...
EDIT: The all caps is merely by convention, but is usually used to represent constants.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With