December 2016
Intermediate to advanced
332 pages
6h 2m
English
Let's go over the basic data types that you will encounter in Python.
A number may be an integer, a real number, or a complex number. The usual operations are:
+ and -* and /**Here is an example:
2 ** (2 + 2) # 16 1j ** 2 # -1 1. + 3.0j
The symbol for complex numbers
j is a symbol to denote the imaginary part of a complex number.
It is a syntactic element and should not be confused with multiplication by a variable. More on complex numbers can be found in section Numeric Types of Chapter 2, Variables and Basic Types.
Strings are sequences of characters, enclosed by simple or double quotes:
'valid string' "string with double quotes" "you shouldn't forget comments" ...
Read now
Unlock full access