O'Reilly logo

Hello World! Second Edition: Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Variable Naming Rules

Here are the rules for variable names (also called identifiers):

  • They must begin with either a letter or an underscore character. Following that, you can use an unlimited sequence of letters, numbers, or underscore characters.
  • The letters can be uppercase or lowercase, and case matters. In other words, Ax is not the same as aX.
  • The numbers can be any of the digit characters from 0 to 9 inclusive.

Aside from letters, numbers, and the underscore character, no other characters can be used. Spaces, punctuation, and other characters are not allowed in variable names:

~ ` ! @ # $ % ^ & * ( ) ; - : " ' < > , . ? / { } [ ] + = /

The only special character that’s allowed is the underscore character. In case you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required