Computer Science
What will be the output of following Python code?
x, y = 4, 8
z = x/y*y
print(z)
Python
Python Data Handling
36 Likes
Answer
4.0
Working
z = x/y*y
⇒ z = 4/8*8
⇒ z = 0.5*8
⇒ z = 4.0
Answered By
22 Likes
Related Questions
What will be output produced by following code? State reason for this output.
a, b, c = 1, 1, 1 d = 0.3 e=a+b+c-d f=a+b+c == d print(e) print(f)
Consider the following expression:
x = "and" * (3 + 2) > "or" + "4"
What is the data type of value that is computed by this expression?
What will be the output of following Python code?
a = 12 b = 7.4 c = 1 a -= b print(a, b) a *= 2 + c print(a) b += a * c print(b)
Make change in the expression for z in the Python code given below so that the output produced is zero. You cannot change the operators and order of variables. (Hint. Use a function around a sub-expression)
x, y = 4, 8 z = x/y*y print(z)