Skip to Content
Hello World! Third Edition
book

Hello World! Third Edition

by Carter Sande, Warren Sande
December 2019
Beginner content levelBeginner
496 pages
15h 37m
English
Manning Publications
Content preview from Hello World! Third Edition

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.
  • The name can’t be a Python reserved word.

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Rotoscoping

Rotoscoping

Benjamin Bratt
Modern SVG

Modern SVG

Amelia Bellamy-Royds, Kurt Cagle
Wicked Cool Shell Scripts, 2nd Edition

Wicked Cool Shell Scripts, 2nd Edition

Dave Taylor, Brandon Perry

Publisher Resources

ISBN: 9781617297021Publisher SupportPublisher WebsiteSupplemental ContentErrata PagePurchase Link