Operators Are Standing By

Operators are another tool for working with data. You'll recognize arithmetic symbols such as + and / for addition and division, but Python also comes with operators that cut up text, check whether two objects have the same value, and so on. This section introduces several kinds of Python operators:

• Arithmetic: The math symbols we're all familiar with as well as some less-well-known ones.

• Comparison: These operators tell you which of several things is bigger.

• Logical or Boolean: These operators test whether things are true or false.

• Conditional: This operator allows you to choose one of two values based on a logical test.

Was this article helpful?

0 0

Post a comment