Why is a-variable-name not valid? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is a-variable-name not valid?

I want to name a variable. So I named it with the above name. But it gives an error message. Why?

22nd Dec 2017, 2:32 AM
Sunny Tiwary
Sunny Tiwary - avatar
3 Answers
+ 16
Variable names can only have letters, numbers, and underscores. Dashes aren't valid characters.
22nd Dec 2017, 2:37 AM
Tamra
Tamra - avatar
+ 6
Please write a more detailed question! so that people can understand and answer you! Hope for understanding @Sololearn
22nd Dec 2017, 2:35 AM
James16
James16 - avatar
+ 5
What tamra said. Right now it looks like you're subtracting "variable" from "a"!
22nd Dec 2017, 2:47 AM
Schindlabua
Schindlabua - avatar