State the order of evaluation of the operators in each of the following Python statements and show the value of x after each statement is performed.
a) x = 7 + 3 * 6 / 2 - 1
b) x = 2 % 2 + 2 * 2 - 2 / 2
c) x = ( 3 * 9 * ( 3 + ( 9 * 3 / ( 3 ) ) ) )
a) x = 7 + 18 / 2 - 1
x = 7 + 9 - 1
x = 16 - 1
x = 15
b) x = 0 + 2 * 2 - 2 / 2
x = 0 + 4 - 2 / 2
x = 0 + 4 - 1
x = 4 - 1
x = 3
c) x = ( 3 * 9 * ( 3 + ( 9 * 3 / 3 ) ) )
x = ( 3 * 9 * ( 3 + ( 27 / 3 ) ) )
x = ( 3 * 9 * ( 3 + ( 9 ) ) )
x = ( 3 * 9 * ( 3 + 9 ) )
x = ( 3 * 9 * ( 12 ) )
x = ( 3 * 9 * 12 )
x = (27 * 12)
x = (324)
x = 324
Computer Science & Information Technology
You might also like to view...
A cellular Internet connectivity plan is also known as a ________ plan
A) text B) data C) network D) mobile
Computer Science & Information Technology
Common fields serve different purposes in different tables
Indicate whether the statement is true or false
Computer Science & Information Technology