13,420
edits
Changes
→PART 5 - MATH OPERATORS
10 / 5 # division
10 ** 5 # exponents
</source><br>NOTE: You must be careful when combining more complex math operators together. Python uses '''PEMDAS''' ('''P'''arentheses, '''E'''xponents, '''M'''ultiplication and '''D'''ivision, '''A'''ddition and '''S'''ubtraction) to resolve math. <br><br>:# Go over the below examples and see if you understand each situation.:<source>
10 + 5 * 2 # multiplication happens before addition
(10 + 5) * 2 # parentheses happen before multiplication