Q. Arithmetic Operators' practice: (Interactive mode)


x = 29.0
y = 13
z = 2
p = 0.5
q = 12.79
i = 13
j = 29.0
k = y - 11

 
S. No. Reason Result Reason
1 x / y
2 x // 4
3 y - i + p
4 y ** z
5 y ** p
6 y % z
7 x / j
8 q % p
9 y + z % 4
10 (y + z) % 4
11 y + (z * 4)
12 y * x / z
13 y / x * z
14 R = p + z - x / y * y **z // x % (p + z)
15 4** 3 ** z

Answer :-

S. No. Reason Result Reason
1 x / y 2.230769230769231 ‘/’ operator simply divide expression.
2 x // 4 7.0 ‘//’ operator return only quotient.
3 y - i + p 0.5 It simply solved the expression.
4 y ** z 169 ‘**’ operator returns power value as per syntax.
5 y ** p 3.605551275463989 ‘**’ operator returns power value as per syntax.
6 y % z 1 ‘%’ operator return only reminder.
7 x / j 1.0 ‘/’ operator simply divide expression.
8 q % p 0.28999999999999915 ‘%’ operator return only reminder.
9 y + z % 4 15 Solve as per precedence order of operator.
10 (y + z) % 4 3 Precedence order of paratheses bracket greater then ‘%’ operator.
11 y + (z * 4) 21 Precedence order of paratheses bracket greater then ‘+’ operator.
12 y * x/z 188.5 Precedence order of ‘*’ greater then ‘/’ operator.
13 y / x * z 0.896551724137931 Precedence order of ‘*’ greater then ‘/’ operator.
14 R = p + z - x / y * y ** z // x % (p + z) >>> R = p + z - x / y * y ** z // x % (p + z)
>>> R
2.0
Solve as per precedence order of operator.
15 4** 3 ** z 262144 It simply solved the expression.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post