Wiki Page, Summer Workshop Math and CS: Python Programming: Variables

Wiki Page
2016-07-27T21:00:17-06:00

In programming, the term variable is used to describe an element that stores a value.

DO NOT GET CONFUSED: It has nothing to do with the term variable used in Math! It just happen to have the same name.

In coding, variables are used to store different kinds of data. Think of variables as a labeled box in which you store something:

The coding syntax of the above image would be something like:

Name = "Maria"

Instead of reading it as "name equals Maria", it might be more meaningful if you read it as "the variable called Name gets assigned the value Maria"

Notice that the value "Maria" is surrounded with quotation marks, which means that the value "Maria" is text or a "string" (a sequence of characters).

In addition to string, other types of data include integer, float, and boolean.