Learn operator precedence Python 3


show more Understanding operator precedence provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training show less
please wait ...

Understanding operator precedence

As you are writing code in Python, there are a lot of opportunities for you to use various expressions. And some of these expressions might have a number of operators and a number of factors. For example, let's say that you have an expression that looks something like this: 5 * 25 + 14 / 2. And you might look at an expression like that, maybe you didn't code it yourself, maybe somebody else did, and you are looking at some code and you see that and you say, hmm, is that 5 times the sum of 25 + 14, with the result of that divided by 2, or is it 5 times 25 plus the result of 14 divided by 2, or some other combination? The answer to this question lies in the subject of operator precedence.

When there are a number of different operators in one expression, which operations get evaluated first? And the results of that operation would then be used in operating on the other operators. So in this case, I happened to know, because I looked it up, that multiplication and division have a highe...

Understanding operator precedence
Video duration: 4m 21s 6h 36m Beginner

Viewers:

Understanding operator precedence provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training

Subjects:
Developer Web
Software:
Python
Author:
please wait ...