Hello, in this video we are going to look up operator precedence in Python. So operators don't all have the same sort of priority, depending on which one comes first and its precedence. The actual result might actually varies a lot to deal with essential numbers. The purpose of this tutorial to keep it simple, but here is a list of all of the operators and their precedence. So first is exponent 10. You know, your D complement, you know, do mathematical operations, and all the way down to the logical operators they are last.
So again, we'll just be dealing with just a few of them and in terms of numbers, and I'll put a link to this in the video I mean with the video so you can access that for later reference. Okay, on a crazy variable called Baldwin and the city today, so let's have a look. So it says exponent is first And then after it's the fly. Now the mathematical operations, the simple one, so let's do five squared plus seven. And now let's do the same, almost to make five plus seven. I mean five plus seven.
So I'm just going to show you the high ball one. Getting bought to some luck, mana fancy. Oh yeah. Let's run it. Okay, you're 32 and 54, two different. Okay, so the first one, it goes through this table essentially.
Okay, exponent Does that exist? Yes. So it's five squared, which is 25. And then the next operator is down here and only one more. So plus seven gives us 32. Whereas with this one, it first checks.
Does a exponent operator list? Yes, it does, right? So seven squared is 49. Then it goes to the next opposite even though this is written First, it goes to it afterwards because of the precedence plus five, on 249, you get 54. And honestly, there's not much more to it than that, you know, depending on the order, you yield, you know, different results, so just bear that in mind. That's it for this video on operator precedence.
Thanks for watching, and I look forward to seeing you in the next video.