What are variables?
In Python, variables simply let you label and store/reference data. For example:
strings
| |
Strings represent text characters either quoted with '' or ""
standard variables
| |
Syntax rules for variable names
Variable names cant start with numbers, only underscores or letters.
You cant use special characters in name.
They are case sensitive and are treated unique if cases differ.
breaking these rules will spitout a SyntaxError and display it in the logs.
Industry practices
- variables should be lower case
| |
- Descriptive names are the got to, you want people to be able to read your code and understand it. For example, a varible for ticker price should clearly say
ticker_pricenottp,priceorticker.
Comments
Code documentation is essential not only for others but for yourself to understand what your code does. in python, # comments all things after in a line.
| |