Legal variable names:
myvar = "John"
my_var = "John"
_my_var = "John"
myVar = "John"
MYVAR = "John"
myvar2 = "John"
Try it Yourself »
Remember that variable names are case-sensitive
Variable names with more than one word can be difficult to read.
There are several techniques you can use to make them more readable:
Each word, except the first, starts with a capital letter:
myVariableName = "John"
Each word starts with a capital letter:
MyVariableName = "John"
Each word is separated by an underscore character:
my_variable_name = "John"
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!