CHAPTER 2

image

Variables

Variables are “slots” that we can store data in. Some languages, such as C#, Visual Basic, and others, require you to declare your variables before you use them along with the type of variable it is, for example, Integer or String. Python doesn’t require you to do this. As I said in the Introduction, Python uses a scheme called “Duck Typing.” This means that you don’t have to declare variables before they are used and that you don’t have to specify what a type variable is or will be. There is a mix of opinions on this as to whether it is a good or bad thing.

Case Sensitivity

Variables names must start with either a letter ...

Get The Python Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.