Complex
numbers
Floating point real values
Signed integers
Long integers
Strings
Python strings are defined as an adjacent group of characters
displayed in the quotation
marks. This programming language lets you use pairs of double or single quotes. You can
obtain the subgroups of strings by using a slice operator ([ : ] and [ ]).
The “+” symbol is the operator for combining strings, while the “*”
sign is used for
repetition.
Lists
Python lists are known to be the most flexible data type in this programming language. A
list is a group of characters that contains objects enclosed within brackets and are
separated by commas. In some way, Python lists are similar to “arrays” in the C language.
The values inside a list can be taken by using a slice operator.
Similar to Python strings,
the “+” symbol is used for mixing (concatenation) purposes while for repetition, the
asterisk “*” is employed.
Because of their importance in the Python language, the next
chapter will further discuss
their characteristics.
Dictionaries
A dictionary in the Python language works like the related hashes or arrays used in Perl.
The key of a dictionary can be any type of Python variables, but strings and numbers are
most commonly used.
These dictionaries are enclosed within curly brackets. Values,
on the other hand, can be
assigned and obtained by using the square brackets.
Tuples
This is a data type similar to a Python list. It consists of a group of values disjointed by
commas. However,
unlike Python lists, these tuples are expressed inside parentheses. This
data type is considered as a read-only list. It cannot be modified or updated.