Operations

Use an equals sign (=) to assign values.

For example, to assign the value "3" to a variable called "x" you would use the following statement:

x = 3

You can also use the equals sign to assign string type data to a variable. For example, to assign the value "a string value" to the variable "y" you would use the following statement:

y = "a string value"

The following table lists some commonly used comparison and numeric operations, and their descriptions.

Table 1. Common comparison and numeric operations
Operation Description
x < y Is x less than y?
x > y Is x greater than y?
x <= y Is x less than or equal to y?
x >= y Is x greater than or equal to y?
x == y Is x equal to y?
x != y Is x not equal to y?
x <> y Is x not equal to y?
x + y Add y to x
x - y Subtract y from x
x * y Multiply x by y
x / y Divide x by y
x ** y Raise x to the y power