variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson


i know for a fact that variables can not be named with capitals so please tell me if i am correct or not?

18th Jun 2019, 9:38 AM
Brooklyn Ocallaghan
Brooklyn Ocallaghan - avatar
1 Answer
+ 5
You can use capitals, but there's a convention to only use capitals at the beginning of class names. And using nothing but capitals for a name suggests to the user, that this variable should not be changed, like: ETERNAL = 42 Capitals are further used IN names when you want to offset words, like: myVarName. Rulewise, nothing stops you to go crazy and write something like: ToTaLlYcRaZy = True
18th Jun 2019, 10:12 AM
HonFu - avatar