Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

intro to python what does the following python program print? x = 9 + 6…

Question

intro to python
what does the following python program print?
x = 9 + 6 / 3 * 2 - 1
print(x)
15
21
12
9

Explanation:

Step1: Follow order of operations (PEMDAS) for division and multiplication

First, calculate $6/3*2$. Since division and multiplication have the same precedence and are done from left - to - right, $6/3 = 2$, then $2*2=4$.

Step2: Calculate addition and subtraction

Now, calculate $9 + 4-1$. First, $9 + 4=13$, then $13-1 = 12$.

Answer:

12