November 2001
Beginner
320 pages
5h 53m
English
Python supports a very similar set of operators to those supported by Perl. The major difference is that operators in Python tend to be consistent across all the different object types. We've already seen examples of this with the + and * operators. The other place where this has an effect are the comparison operators – Python uses only one set of operators which can be used for comparing numbers and strings, Perl uses different operator sets.
Also, the different parentheses and braces are used to define the object type, rather than being used to access information from different objects. For example, the [] brackets are used to create a list, and also to extract the information from any sequence type and dictionaries.
The operators ...