Informatics Practices
Write Python expressions equivalent to the following arithmetic/algebraic expressions:
(a)
(b)
(c)
(d)
(e)
(f) (u, a, t are variables)
Python Funda
5 Likes
Answer
(a) (a + b) / 2
(b) (32 + 93) / 2
(c) 32 + 93 / 5
(d) a**0.5 + (a + 2) / b
(e) 8 - 6 + 6 * sum / 7 - var**0.5
(f) u * t + 1 / 2 * a * t**2
Answered By
3 Likes
Related Questions
Find the output of the following code:
p = 5 % 2 q = p ** 4 r = p // q p+= p + q + r r+= p + q + r q-= p + q * r print(p, q, r)
Find the output of the following code:
p = 21 // 5 q = p % 4 r = p * q p+= p + q - r r*= p - q + r q+= p + q print(p, q, r)
Write Python expressions to represent the following situations:
(a) Add remainder of 8/3 to the product of 8 and 3.
(b) Find the square root of the sum of 8 and 43.
(c) Find the sum of the square roots of 8 and 43.
(d) Find the integral part of the quotient when 100 is divided by 32.
What are operators ? What is their function ? Give examples of some unary and binary operators.