- Variables tend to start with a letter.
- Spaces are not allowed in variables
- Special characters such as “!,-,@” are not allowed in the name
- Digits are allowed but keep Rule number 1 in mind.
Example of valid names
Example of invalid names
Variable names should clearly express how the variable is going to be used. For example, the following names are valid but not typically a good idea to use:
tuna = 32
TheResultsFromACalculationWithALongName = ((32 + x) / 5)
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More