Professional Documents
Culture Documents
1.1 Variables
A variable is a container for storing data. In python, we can save data by assigning them variable
names. This is done by the assignment operator → =. The variable name goes to the left of the equal
sign, while the data we are assigning goes to the right of the equal sign. The variable name
represents a location in computer memory where, after the assignment statement executes, the data
a=5
A = 10
int: x = 4
float: y = 5.0
complex: z = 2 + 4i
Boolean – bool
the parenthesis. In addition, we can do an assignment of the various data types with or without the
constructor functions.
1.3.1 Input
1.3.2 Output
Exercises
1. There are rules for naming python variables. What are they?
2. Asides from taking user input via typing, input can be gotten from an external file.