Session 1 - Section: Getting to know Python

Data Types

String

Literally, a "string" of characters, if it is enclosed in single or double quotation marks.

For example: "This is a string"

Numbers

Numbers have two different types, integer (no decimal point) and float (with decimal point).

For example: 1 (integer), 1.0 (float)

Assignments and Variables

Variables

A variable is a name we give to a specific value.

Assignments

Assignments are statements that assign a specific value to a variable.

For example: pi = 3.1415 (assigning value 3.1415 to the variable pi)

Operations

Operands and Operators

Operations use operands (variables or values) and operators (+, -, /, *) to perform a task like addition, multiplication and assignment.

Order of Operation

Parenthesis is first, exponentiation second, multiplication and division third and addition and substraction last. If there is a same precedence then it is left to right.